Projects / SQLiteJDBC / Comments

Comments for SQLiteJDBC

24 Nov 2010 23:22 mozkill

Is there a way to pass a PRAGMA argument to turn OFF sync while instantiating the connection , using a argument to the JDBC driver? The SQLite ODBC driver will do this and I cant use the JDBC driver unless it has this feature since my project has transactionless code and inserts are slowed down greatly by the sync code.

16 Jun 2009 08:11 francesco_alesiani

is it possible to load sqlite extension? (based on platform, e.g. .so or .dll)?

Thank you,
Francesco

06 Jun 2009 04:06 cbare

I'd like to compile the JNI bindings for 64-bit OS X so the sqlite-jdbc drive can be used in native mode from Java 6 on OS X (which is 64-bit only). If anyone would be willing to help me, that would be great.

23 Apr 2009 01:57 lilbill39

First off, thanks for this great tool...I too am a mathematics major graduating this semester! Does this driver support running SQLite's dot commands like, '.output', '.mode' etc?

09 Apr 2009 15:57 naquah

There appears to be a problem with wasNull() after getObject() has been called. I submitted a ticket about this, but I'm not sure if that is the right way to submit a bug.

In particular, the implementation of getObject() in the RS class calls the checkCol() method, while all other get*() methods call the markCol() method. Only the markCol() method properly updates the lastCol instance variable, which in turn is used by the wasNull() method.

This is making Hibernate fail with enum fields that are NULL.

29 Mar 2009 13:09 civildisobedient

This + Hibernate + SQLite = the easiest data store you'll ever need for a webapp. Thank you!

A couple of gotchas: doesn't handle Timestamp.class very well (workaround: store timestamps in unix "secs. since epoch" format, then write a special Hibernate UserType to convert back and forth). Also, you must be VERY specific with your connection path (jdbc:sqlite:[database.db]), otherwise you'll see empty databases with no tables. The problem is that the default behavior of SQLite is to create a *new* database when it doesn't find the database file. Which means if you specify the wrong connection path, it just happily gives you a new, blank database instead of an exception. If you're running, say, SquirrelSQL from C:\Program Files\squirrelsql, you have to use relative paths and "walk" up the file tree, then back down again to the directory of your database file. For instance: jdbc:sqlite:..\..\db\database.db.

21 Mar 2009 16:43 jldominguez

Sorry, in case you need it, my email is:
juan_lucas_dr at yahoo dot com

21 Mar 2009 16:41 jldominguez

Hello. Thanks for this great software. I have tried the pure-Java version on Openmoko ( http://wiki.openmoko.org/wiki/Main_Page ) to store JTS geometries:

[...]
byte[] wkb = JTSConverter.toWKB(geom);
prep = conn.prepareStatement("insert into " + table_name + " values (?, ?, ?, ?, ?);");
prep.setBytes(1, wkb);
[...]
Statement stat = conn.createStatement();
ResultSet rs = stat.executeQuery("select * from " + table_name + ";");
while (rs.next()) {
byte[] bb = rs.getBytes(1);
IGeometry ig = JTSConverter.toGeometry(bb);
}
[...]

And it worked :)

Questions:

- I still have not tried, but it should be possible to compuile the c sources and get a JNI (faster) version for Freerunner-Openmoko (Linux-based on ARM), right? Do you think the performance would be significantly better?

- Is there any plan to add the spatial module (Spatialite) to this Java driver?

- My software in GPLv2. If I include this driver in it, I still can say that the resulting application is GPLv2, no?

Thanks,
Juan Lucas

08 Jan 2009 17:54 miketolbert

SQLiteJDBC connection question?
I am having trouble establishing a connection to an sqlite db (version 3.6.7) on windows. I've written a standalone test class as well as setup in SquirrelSQL, and it appears the driver does not throw an exception if the path to the db file is invalid. For example, I've tried tried passing valid and invalid paths to DriverManager.getConnection() and I get the same result. In SQuirrelSQL it shows connection successful, but no tables exist. I get a connection object back fine, and I can run detDriverVersion() which prints out "native". However, when I try to create a Statement/PreparedStatment I get "java.sql.SQLException: no such table:" error.

I created the database using sqlite3 command-line program. I've added the driver to classpath and using your example Test class on http://www.zentus.com/sqlitejdbc/.

Is there something I am missing?

Thanks for your time.

13 Dec 2008 18:37 talkout

Thanks....!
Thanks for this library.

Peace!

Screenshot

Project Spotlight

ReciJournal

An open, cross-platform journaling program.

Screenshot

Project Spotlight

Veusz

A scientific plotting package.