views:

117

answers:

1

in the sqlite database, i set a field typed blob. then, i wrote java code:

PreparedStatement preStmt = con.prepareStatement("INSERT INTO zz(pic) VALUES(?)");
preStmt.setBinaryStream(1, new FileInputStream(file), file.length());

i got a exception:

java.lang.AbstractMethodError: org.sqlite.PrepStmt.setBinaryStream(ILjava/io/InputStream;J)V

any suggestion ?

Or, what code i should write if i want to use save binary number in sqlite ?

A: 

The AbstractMethodError API documentation tells the following:

Thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.

Apparently you have an older version of the JDBC driver wandering in the classpath, or your JDBC driver needs to be upgraded to match the JDBC API in the JRE version used. You can get the latest version at the Sqlite homepage.

BalusC