Having followed the example given at
http://www.zentus.com/sqlitejdbc/ I was able to run it successfully. A little modification however:
Code:
while (rs.next())
{
System.out.println("name = " + rs.getString("name"));
System.out.println("job = " + rs.getString("occupation"));
}
System.out.println(rs.getMetaData().getColumnCount()); // <- MODIFIED
rs.close();
conn.close();
Throws this Exception:
Code:
Exception in thread "main" java.lang.IllegalStateException: SQLite JDBC: inconsistent internal state
at org.sqlite.RS.checkCol(RS.java:62)
at org.sqlite.RS.getColumnCount(RS.java:319)
at workshop.Test.main(Test.java:53)
Java Result: 1
I have Googled around but no fix I find. Any help please?