views:

485

answers:

4

This article from IBM about a JDBC wrapper seems good and I'm tempted to use it:

http://www.ibm.com/developerworks/java/library/j-jdbcwrap/index.html

but it its dated 2001 - is it still relevant to today's best practices or has this been superseded by something else better?

Your opinions are much appreciated.

A: 

After a short glance at the source code of Table I’d strongly advise against it as it does nothing to prevent SQL injections. You’re a lot better of using “normal JDBC”, especially PreparedStatement.

Bombe
+1  A: 

If you don't mind adding third party libraries - take a look at Spring.

They have some very nice wrappers and abstractions around JDBC - they can significantly reduce code clutter. You will end up adding an XML config file but this isn't necessarily a bad thing.

Spring can use pooling libraries to help with connection management - important in an enterprise environment.

Fortyrunner
+1  A: 

Also have a look at the Java Persistence API (JPA). It's another abstraction layer which can help you avoid any SQL or DAO's completely.

Cogsy
You might still want to use SQL, for doing relational type things.
Tom Hawtin - tackline
A: 

Spring with Hibernate is what you need.

Lonzo