java.sql.SQLException: SQL logic error or missing database

Posted by Sunil Kumar Sahoo on Stack Overflow See other posts from Stack Overflow or by Sunil Kumar Sahoo
Published on 2010-03-16T15:18:39Z Indexed on 2010/03/16 15:21 UTC
Read the original article Hit count: 688

Filed under:
|
|

Hi All, I ahve created database connection with SQLite using JDBC in java. My sql statements execute properly. But sometimes I get the following error while i use conn.commit() java.sql.SQLException: SQL logic error or missing database

Can anyone please help me how to avoid this type of problem. Can anyone give me better approach of calling JDBC programs

Class.forName("org.sqlite.JDBC"); conn = DriverManager.getConnection("jdbc:sqlite:/home/Data/database.db3"); conn.setAutoCommit(false);

String query = "Update Chits set BlockedForChit = 0 where ServerChitID = '" + serverChitId + "' AND ChitGatewayID = '" + chitGatewayId + "'"; Statement stmt = null; try {

        stmt.execute(query);

        conn.commit();
        stmt.close();
        stmt = null;
    }

Thanks Sunil Kumar Sahoo

© Stack Overflow or respective owner

Related posts about jdbc

Related posts about java