Hi Magnus,

Are you using the pure java jdbc driver (NestedVM) or the Native code 
jdbc driver ?

XR

Magnus Ahltorp a écrit :
> When I do a commit of a transaction that consists of a select, I get  
> the following error:
>
> Exception in thread "main" java.sql.SQLException: SQL logic error or  
> missing database
>          at org.sqlite.DB.throwex(DB.java:252)
>          at org.sqlite.DB.exec(DB.java:31)
>          at org.sqlite.Conn.commit(Conn.java:121)
>          at SQLiteTest.main(SQLiteTest.java:17)
>
> Also, when I call isBeforeFirst() on a ResultSet, I always get false,  
> even before I have called next() on the ResultSet.
>
> /Magnus
>
> SQLiteTest.java:
>
> import java.sql.*;
>
> class SQLiteTest {
>
>      public static void main (String args[]) throws Exception {
>
>          String url = "jdbc:sqlite:/tmp/test.sqlite";
>          Class.forName("org.sqlite.JDBC");
>          Connection con = DriverManager.getConnection(url, "", "");
>          con.setAutoCommit(false);
>          Statement st = con.createStatement();
>          st.execute("create table foo (id integer)");
>          con.commit();
>          st.execute("insert into foo (id) values (1)");
>          con.commit();
>          st.execute("select * from foo");
>          con.commit();
>      }
> }
>
> SQLiteTest2.java:
>
> import java.sql.*;
>
> class SQLiteTest2 {
>
>      public static void main (String args[]) throws Exception {
>
>          String url = "jdbc:sqlite:/tmp/test.sqlite";
>          Class.forName("org.sqlite.JDBC");
>          Connection con = DriverManager.getConnection(url, "", "");
>          Statement st = con.createStatement();
>          st.execute("select 1");
>          ResultSet rs = st.getResultSet();
>          System.out.println(rs.isBeforeFirst());
>          rs.next();
>          System.out.println(rs.getInt(1));
>      }
> }
>
>
> >
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLiteJDBC" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlitejdbc?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to