Leszek Gawron wrote:
On Mon, Apr 19, 2004 at 03:24:50PM +0200, Ugo Cei wrote:

Leon Widdershoven wrote:

But I'm glad to hear that Hibernate is quite easy to start with.
The moment I get some time off I will certainly jump in the
deep and try to survive:)

There is a middle ground between a full-fledged O/R mapping layer and raw JDBC calls. You could, for instance, try Spring's JDBC template classes [1], as they take care of the tedious, repetitive and error-prone, like setting up a connection, managing transactions, handling errors and properly releasing resources.


An advantage of using Spring is also that it supports Hibernate and JDO out-of-the-box, so graduating from JDBC to an O/R persistence layer might be easier.

DISCLAIMER: I've never used Spring, just read its documentation and I really like what I've seen so far. Might be using it for a future project, though.

Ugo


http://www.springframework.org/docs/reference/jdbc.html

There is also a library called DbUtils at Jakarta (http://jakarta.apache.org/commons/dbutils/).

DISCLAIMER: I've never used DbUtils, just read its documentation :)

quote:
DbUtils is a small set of classes designed to make working with JDBC easier.
JDBC resource cleanup code is mundane, error prone work so these classes
abstract out all of the cleanup tasks from your code leaving you with what you
really wanted to do with JDBC in the first place: query and update data.


lg

I also read the docs for that. As it happens I already had a home grown mini library to do just that before I saw this. There are quite a lot Java packages that work more comfortable if you just wrap them in some exception-catching auto-initialisation classes:)

The original topic was, though, that there is no easy default for database
access within flowscript. And I think a "light" and "advanced" "recommended"
way for database access from within flowscript would do a lot of good. This
is, though, not going to happen if I've followed the discussion right:)


Leon




Reply via email to