how to write a BLOB into a database when PreparedStatement.setBlob() not
implemented by JDBC driver
After I used the following code to write a BLOB value to a database:
// bb is of type ByteBuffer
Blob blob = new SerialBlob(bb.array());
sqlStatement = "UPDATE Words SET Examples=? WHERE Word=\"" + word + "\"";
// c is of type Connection
PreparedStatement pstmt = c.prepareStatement(sqlStatement);
pstmt.executeUpdate();
c.commit();
I got the following error:
java.sql.SQLException: not implemented by SQLite JDBC driver
No matter where I downloaded this driver from, my question is whether you
know of any SAFE method to write a BLOB value to a SQLite database.
No comments:
Post a Comment