I have the following code:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.SQLException;


public class CheckProverbsLocked {
    private CheckProverbsLocked() {
    }

    public static void main(String [] args) throws Exception {
        Connection   conn;
        Statement    stmt;

        Class.forName("org.sqlite.JDBC");
        conn = DriverManager.getConnection("jdbc:sqlite:proverbs.sqlite");
        stmt  = conn.createStatement();
        try {
            stmt.executeUpdate("begin immediate");
        } catch (SQLException e) {
            System.out.println(e.getErrorCode());
            System.out.println(e.getMessage());
            System.out.println(e.getSQLState());
        }
        stmt.close();
        conn.close();
    }

}


?I get the following output when the database is locked:
0
database is locked
null

?I would expect the first one to be 5?. What am I doing wrong?

-- 
Cecil Westerhof

Reply via email to