tags:

views:

154

answers:

7

Are there any libraries create programs in java that uses a file as a database and you don't have to install database services on the computer you are going to use it?

+4  A: 

there is a very good java binding for SQLite databases called SqliteJDBC:

http://www.zentus.com/sqlitejdbc/

clamp
+3  A: 

We are successfully using http://www.sqlite.org/ along with http://www.zentus.com/sqlitejdbc/ as JDBC driver.

Manuel Selva
+5  A: 

Derby and Hypersonic SQL can both be run in memory and server modes.

duffymo
+1. This should be the answer, not sqlite which requires platform specific libraries. Just add some links: http://db.apache.org/derby/ http://hsqldb.org/ http://www.h2database.com/html/main.html
tulskiy
+1  A: 

For example HSQLDB or Apache Derby can run in Embedded mode.

MarrLiss
+2  A: 

Derby can run in the Embedded mode as mentioned above. It actually is included in Java 6 SE and called Java DB instead (although it is really just Apache Derby). It is quite easy to use, although the default database tool (ij) isn't great. I would use something like SQuirreL SQL to view the data.

Awaken
+1  A: 

Besides the already mentioned embedded relational databases, there are also non-relational embedded Java databases like exist (an XML DB) or db4o (an object DB).

Fabian Steeg
+3  A: 

What about H2?

H2 is a relational database management system written in Java. It can be embedded in Java applications or run in the client-server mode. The disk footprint (size of the jar file) is about 1 MB. (Wikipedia)

Alexander