Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Small footprint embedded Java SQL database

Tags:

java

sql

database

I'm looking for an embedded SQL database for Java, with a small footprint. Something like SQLite, but it should be pure Java. So far I've seen HSQLDB, H2 and Apache Derby, but they're not what could be called small footprint. Ideally, the database I'm looking for would be embeddable in a J2ME application.

Is there something like this?

like image 886
rid Avatar asked Jun 18 '11 14:06

rid


People also ask

What is the best embedded database for Java?

A few of the dominant providers are H2, HyperSQL, Apache Derby, Berkley DB, Java DB, ObjectDB, and so forth. HyperSQL conforms to the SQL:2011 standard and JDBC 4 specification and supports every classical feature expected from a modern relational database.

Which database is written in Java?

H2 is a relational database management system written in Java. It can be embedded in Java applications or run in client-server mode. The software is available as open source software Mozilla Public License 2.0 or the original Eclipse Public License.

What is Hsqldb in-memory database?

HSQLDB (HyperSQL Database) HSQLDB is an open source project, also written in Java, representing a relational database. It follows the SQL and JDBC standards and supports SQL features such as stored procedures and triggers. It can be used in the in-memory mode, or it can be configured to use disk storage.

Is H2 a SQL database?

H2 is an open source Java SQL Database. It can be run in both embedded and server mode. It is widely used as an In-memory database. In-memory database relies on system memory as oppose to disk space for storage of data.


4 Answers

Take a look at HSQLDB or H2DB

or possibly a light key value based database like jdbm2

like image 164
Omnaest Avatar answered Oct 06 '22 01:10

Omnaest


Yes, there is an Apache project for that called Apache Derby.

like image 27
Pablo Santa Cruz Avatar answered Oct 06 '22 01:10

Pablo Santa Cruz


You may try http://www.jepstone.net/tinySQL/.

Pros:

  • It is small (93k!)
  • It is embeddable
  • It uses DBF or text files files to store data, so they are easy to read.

Cons:

  • It is an old unmaintained project
  • It is not designed to work in j2me, but since it can work in JDK 1.1.8 it won't be hard to make it work in j2me. Of course you will have to change some code from using RandomAccessFile to FileConnection and stuff like that, but at least you wont need to mess with generics related code.
  • It is not very fast, because it does not use indexes, so you need to try and see if it is fits yuor needs
  • It is not feature complete, just gives you a small subset of SQL
like image 28
Pablo Grisafi Avatar answered Oct 06 '22 00:10

Pablo Grisafi


You can also look at:

  • Floggy - http://floggy.sourceforge.net/
  • Perts Lite - http://www.mcobject.com/j2me_database/
  • J2MEMicroDB - http://morfeo.upc.es/crom/mod/wiki/view.php?id=16&page=Qu%E8+%E9s+J2MELSDATALIB&gid=0&uid=0
  • HandyDB - http://sourceforge.net/projects/rms-db-class/
  • MicroDB - http://sourceforge.net/projects/microdb/
  • OpenBaseMovil - http://www.openbasemovil.org/2007/11/26/openbasemovil-portable-j2me-database-applications/

This list is something I just found on the internet (http://www.coderanch.com/t/230853/JME/Mobile/List-Database-ME) and some of the listed products seems abandoned, but I thought that maybe it can be helpful...

like image 21
mnicky Avatar answered Oct 05 '22 23:10

mnicky