sql - insert a picture into database(sqlite) with java code. what should i do? -


In the sqlite database, I set a field type blob. Then, I have written the Java code:

  include prestmt = con.prepareStatement ("zz (pic) values ​​in the prepared place (?)"); PreStmt.setBinaryStream (1, New FileInputStream (file), file.length ());  

I got an exception:

  java.lang.AbstractMethodError: org.sqlite.PrepStmt.setBinaryStream (ILjava / IO / InputStream; J) V < / Code> 

Any suggestions?

Or, what code should I write if I want to save the binary number in sqlite?

Zerial SQLite JDBC implementation has been prepared. State bits (index), byte []). You should be able to get a byte array from your file intstream using the code on the following file:

When things are stored as blops, beware of the following issues:

I hope it helps.

-एक्सक्स


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -