Non-ORM layers over JDBC - Mailing list pgsql-jdbc

From Craig Ringer
Subject Non-ORM layers over JDBC
Date
Msg-id 47E73FE1.5060404@postnewspapers.com.au
Whole thread Raw
Responses Re: Non-ORM layers over JDBC
Re: Non-ORM layers over JDBC
Re: Non-ORM layers over JDBC
List pgsql-jdbc
Hi all

I'm fairly new to Java (sorry!) and struggling with the database access
area. My PostgreSQL database is fairy complex and significant parts of
its user interface are through stored procedures etc. I've been looking
into Hibernate / Hibernate EntityManager and other EJB3-compatible
tools, but they all seem to be oriented toward database-independence and
using the DB as a dumb storage engine. They even implement their own
outer joins (!) and other core DB functionality. Currently I'm trying to
figure out why a "SELECT c FROM customer c;" (Hibernate-style) is
introducing a WHERE clause for on the customer's bank_id when executed
... so I'm not impressed so far.

However, I've also looked at raw JDBC code, and it seems to be very
verbose with a lot of manual data conversion and little language
integration.

I'm somewhat spoiled by having come from C++ with TrollTech's Qt, a
toolkit so good that it makes C++ not only worth using but even nice. It
has SQL-enabled widgets with a lot of programmer control, and a very
nice and well integrated SQL interface that doesn't impose too many
weird limits or force you to work around your SQL access layer to do
simple things. It makes good use of variant types and conversion
operators to minimise the amount of manual type wrangling the programmer
has to do.

I've done a fair bit of searching but haven't found any sort of JDBC
over-layer that integrates database access into the Java language a bit
better but without all the ORM database-independence stuff.

What do people here use? Just use the JDBC directly? Use an ORM layer
even though you just target PostgreSQL and work around its limitations
and quirks? Use a different ORM layer without weird limitations and
quirks? Some other tool I haven't been able to find out about?

I'm writing a pretty ordinary desktop app, but I was really hoping to
avoid writing vast amounts of database interface code even for the
simpler parts of the interface, as appears to be necessary with direct
JDBC use.

Comments on what you're using or would like to have used would be very
much appreciated.

--
Craig Ringer

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Atomic operations?
Next
From: David Clark
Date:
Subject: Re: Non-ORM layers over JDBC