views:

66

answers:

2

What solutions exist to persist data, without requiring a full-blown enterprise server? I am fairly new to Java. At uni the whole curriculum was based on Java, so I coded a bit already. But it never went into depth with the available frameworks. The only way we actually touched on persistens was using "vanilla" JDBC connections.

I've done some digging around and came across the typical solutions. Most prominently "JAXB", "JPA", "Hibernate" and "TopLink". As far as I can tell, the last two are actually implementing "JPA", which is just a spec. Am I right here?

All the tutorials I have found so far explained these fairly well, and I have to say that I like JPA quite a lot. But all the tutorials I have seen, explained it all using web-pages. I am looking for a swing based solution however. Without webstart or the likes. I'd like to create a stand-alone Java desktop app. Given the target audience and the requirements, I don't need a client/server architecture anyways.

Now, there is also the topic of Beans Binding. Which, to me, looks like fun. Even considering that you have to fire you "PropertyChanged" events manually. Honestly, I don't care about the few added lines.

So... for creating a stand-alone desktop app, saving (and reading) data from already existing legacy databases:

What are your recommendations of frameworks/libraries/specs?

  • JPA?
  • JDBC?
  • Beans Binding?

One more important thing: The primary database I would be writing the app against contains Mutliple Table Inheritance and Slowly Changing Dimensions. I've been doodling around with TopLink already, and the results are fine. But I want to get rid of the application server.

... oh, and... would it be feasible to use Beans Binding in conjunction with Entities? Making the properties read/writable?

+5  A: 

I recommend JPA -- while it's a standard, it is completely separate from the whole Java EE spec. You don't need a enterprise application server to use it. In fact, Sun has a "Using JPA in Desktop Applications" article.

Kaleb Brasee
A: 

JPA + Hibernate, Derby in memory java database, Swing destop App. After annotating my Model classes and specifying the derby driver and such trivia in XML files, persistency was all automagic.

Gmu