views:

150

answers:

4

I will be implementing a java swing app. At first, I wanted to use apache derby db, because I needed embeded db.

But it turned out that it does not plays nice with hibernate (https://forum.hibernate.org/viewtopic.php?f=6&t=1003258&p=2433546#p2433546, http://stackoverflow.com/questions/3322575/netbeans-derby-hibernate).

Hibernate ignores auto generated keys and foreign keys...

Can you recommand some db that can be embeded and nicely used with hibernate, or derby can work well with hibernate but I'm doing it wrong?

Thanks in advance.

+1  A: 

Try Hypersonic SQL.

duffymo
I saw it's fast. Do you know any gui client better then HSQL database manager? I don't like creating foreign keys and auto increment values from plain SQL. Maybe I should start :)
umpirsky
How else do you propose to do so?
duffymo
For MySQL I use sqlyog http://www.webyog.com/en/screenshots_sqlyog.php
umpirsky
It works good. Embeded mode is a bit difficult for development, but you can develop in server mode, and embed it on production. I think HSQL can be the right choice.
umpirsky
Why not vote the question up as well? I'm glad you accepted it, but the vote would be appreciated.
duffymo
Ah, yes. Done ;)
umpirsky
+3  A: 

I prefer h2, the "Hypersonic 2". See http://www.h2database.com/html/features.html#comparison for a comparsion.

resmo
Will take a look, thanks.
umpirsky
A: 

Have you thought of MySQL embedded

Flakron Bytyqi
It's not free, right?
umpirsky
definitely not free
Flakron Bytyqi
SQLite could do the job, it's free and embeddable
Flakron Bytyqi
It's embeded, but It's not supported by hibernate http://community.jboss.org/wiki/SupportedDatabases
umpirsky
with this little additionhttp://arnoraps.tweakblogs.net/blog/3146/hibernate-with-sqlite.htmlSQLite gets the support you need
Flakron Bytyqi
A: 

All in all, I tested Derby and HSQL, tried to make simple hibernate CRUD app with netbeans.

Both of them set which you need to manually change to if you don't want to worry about generating primary keys, which is not a big deal.

But, derby pojos and mapping files totally ignore foreign table references, didn't tried to add them by hand, but netbeans does not generate them.

HSQL does not have this problem.

People are complaining about corrupted data and inconsistency, they are migrating from HSQL to Derby and from Derby to HSQL.

I don't know if HSQL is good for me and my production use. I would use it in embeded mode for desktop app, and one version for network usage, where it will be in server mode probably, so both.

All suggestions are welcome.

umpirsky