When I execute that code :

import java.sql.*;

public class TestJdbc {

        /**
         * @param args
         */
        public static void main(String[] args) throws Exception{
                Class.forName("org.sqlite.JDBC");
                Connection conn = DriverManager.getConnection
("jdbc:sqlite:test.db");
                Statement stat = conn.createStatement();
                stat.executeUpdate("DROP TABLE IF EXISTS test;");
                stat.executeUpdate("CREATE TABLE test (a);");

                conn.setAutoCommit(false);
                stat.executeUpdate("INSERT INTO test VALUES (\"a\");");

                ResultSet rs = stat.executeQuery("SELECT COUNT(*) FROM test;");
                rs.next();
                System.out.println(rs.getInt(1));

                conn.setAutoCommit(true);
                conn.close();
        }
}

I get that exception :

Exception in thread "main" java.sql.SQLException: SQL logic error or
missing database
        at org.sqlite.DB.throwex(DB.java:288)
        at org.sqlite.DB.exec(DB.java:68)
        at org.sqlite.Conn.setAutoCommit(Conn.java:166)
        at TestJdbc.main(TestJdbc.java:22)

I am using sqlitejdbc056.

Am I doing something wrong ?
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to sqlitejdbc-unsubscr...@googlegroups.com
-~----------~----~----~----~------~----~------~--~---

Reply via email to