Discussion Locked

Make JDBC easier to live with

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
A Java TechMail suggested that a JDBC Util class would help you deal with repeated code and numerous catching of SQLExceptions. We want to know if you think it would?

2 replies

by avia

Here's a quote from the article:

"With the release of JDK 1.4, we'll
all be using the java.log package"

And you base this on...?

In any case, you're really talking more about a JDBC wrapper, than a utility. Something along the lines of the"decorator pattern", no? And yes, we already use such a class at my place of work.

Cheers,
Avi.

by bayard-generationjava

Pure cynicism :)

Java tends to standardise good ideas. Java Regexp
and Log are not as complete as their competitors, but
they're complete enough. Once people move to JDK
1.4 as a standard, I think most will quite happily migrate
away from package like Jakarta ORO, gnu-regexp and
Log4J.

I don't expect the Regexp guys to really battle much,
Sun's version is relatively complete and there isn't a lot
of new things leaping into the regexp world, at least not
enough to give gnu-regexp a big enough reason to
compete. ORO has some perl tools.. so maybe some
sell.

In the Logging world, the question will be whether the
various Logging utils can offer something over the Java
standard. Maybe as there's not a separatelog jar for
Java 1.4 to use in 1.2/1.3, the J2ME world will still have
a keen interest.

We may not be on 1.4 as a standard now, but 1.3 is
starting to sneak in as a standard JVM to be using, so
another year or so and I think a lot of people will
develop against 1.4.

As to Decorator vs Utils, I tend to view a Decorator as
an instance wrapper. JdbcUtils on the other hand is
merely a set of static 'functions' that are called upon
various jdbc instances. So another would be
'close(Connection)' that happily logged/ignored
exceptions.

Thanks for the reply Avi, they're always good reading.

Hen

This discussion is closed to new replies.