tags:

views:

828

answers:

9

I am trying to implement an application for a friend who sells t-shirts and hats, so we are dealing with interconnected tables. I was wondering what would be the perfect libraries to achieve this goal. What kind of database should I use to make it portable and easy to deploy. I would really like to insist on the database stuff, what should I use?

Thank you so much (I use Netbeans)

+3  A: 

Check out Hypersonic and Derby. They are embedded databases that store their data in a simple file so you don't have to worry about installing and managing a complex system like mysql or postgres or sql server. They work with the regular jdbc front end.

Jeremy Huiskamp
A: 

I would use Hibernate (or JPA) in order to create a standard mapping between the relational database and the object oriented java design.

As far as databases are concerned I often use MySql or Oracle XE which are free and robust enough for your purposes.

Yaneeve
I don't think this passes the "easy to deploy" test for desktop software :) I guess maybe if you're only installing it in one place.
Jeremy Huiskamp
mysql is not that hard to deploy and its a fair solution, though it may be a bit heavy for the solution at hand. Another option is SQLServer XE
Nuno Furtado
A: 

you can also use SQLite

chburd
Are there good java bindings for sqlite? If so, it's definitely as good as hypersonic or derby.
Jeremy Huiskamp
im pretty sure hibernate can integrate with sqllite
Nuno Furtado
+1  A: 

For the engine, look into embedded databases like sqllite, derby and hsqldb

For the integration you can either keep it simple and use plain old JDBC which will make things easier to an extent or go the Hibernate or JPA way

Nuno Furtado
+2  A: 

It seems like it needs to go production. Better go for H2, its a better, faster HSQLDB.

Adeel Ansari
A: 

We used HSQLDB initially for a similar application . But after going to production with it some of the users experienced random data corruption ( look though their forum, it seems like a common issue ), So we switched to Derby which proved to be stable . So my vote is Derby .

Also, I would stay away from hibernate for desktop applications due to huge startup time (it has to prepare the metadata upfront ), unless you only have few tables / models.

Surya
A: 

You can use Firebird with JayBird

Firebird is free, very easy to install and setup with good backup

Hugues Van Landeghem
+1  A: 

Here is a Java binding for SQLite. SQLite is very lightweight and should suit your needs very well.

A nice database editor is also a godsend. I recommend SQLite Manager, a Firefox plugin, when working with SQLite.

Joey Robert
A: 

Another option is Perst, an open source, object-oriented database that is 100% Java.

For info on Perst, see www.mcobject.com/perst.

You can download Perst, with source code, at www.mcobject.com/perst_eval.