写入
public boolean saveWordFile(String filePath) {
File file = new File(filePath);
Connection conn = getConnection();
try {
java.sql.Statement st = conn.createStatement();
conn.setAutoCommit(false);
st.execute("insert into table_name values(1,empty_blob())");
ResultSet rs = st
.executeQuery("select id,word from table_name where id=1 for update");
if (rs.next()) {
BLOB blob = (BLOB) rs.getBlob("word");
OutputStream outStream = blob.getBinaryOutputStream();
InputStream fin = new FileInputStream(file);
byte[] b = new byte[blob.getBufferSize()];
int len = 0;
while ((len = fin.read(b)) != -1) {
outStream.write(b, 0, len);
}
fin.close();
outStream.flush();
outStream.clos