I wrote a program that populates a database with a list of words. Problem is, it throws up the \"Exception in thread \"main\" java.sql.SQLException: near \"s\": syntax error\" e
Thanks Rogue for a good code. I had an error in SQLite during INSERT operation, SQL string contained "'" inside a text. So, an escaping in this way helped to me. I've changed a code a bit.
PreparedStatement prst = conn.prepareStatement(
"INSERT INTO test(id, name, type) "
+ "VALUES(?, ?, ?)");
prst.setLong(1, id);
prst.setString(2, title);
prst.setObject(3, type);
prst.execute();
So when I tried to insert a null value in INTEGER column, I used a method setObject().