- Auto-loading of JDBC driver class
- Connection management enhancements
- Support for RowId SQL type
- DataSet implementation of SQL using Annotations
- SQL exception handling enhancements
- SQL XML support
The DriverManager class can now lookup the appropriate database driver using the Java SE Service Provider included in Java 6.0. Class.forName() is no longer needed. The SQLException class has also been enhanced to support nested cause exceptions, next exceptions (when two SQLExceptions may be thrown at a time), and foreach support for iterating over exceptions. Blogger Patrick Lightbody noted "I could see JDBC 4.0 replacing my need for iBatis" after reading another blog post on JDBC 4.0 functionality. JDBC 4.0 includes basic O/R mapper functionality that eases the repetitive task of copying ResultSet data into objects. It does not handle inheritance or table relations however.
Community comments
I wish.
by Clinton Begin,
Re: I wish.
by Patrick Lightbody,
Re: I wish.
by Cameron Purdy,
Re: I wish.
by Javier Pavier,
I wish.
by Clinton Begin,
Your message is awaiting moderation. Thank you for participating in the discussion.
I wish Patrick was right. However, I bet the JDBC 4 features highlighted above will be generally useless for all but the simplest applications.
First, it will take way too long to get it out. Second it will take way too long for any significant market share to adopt (JDK 5 is still only about 15 - 20% adoption). Finally, Sun/JCP won't have the courage to take it as far as they'd need to in order to make it competetive with iBATIS, Hibernate or any other persistence solution.
I have little faith.
DISCLAIMER: I'm obviously biased. But, I'm entitled to an opinion anyway... ;-)
Re: I wish.
by Patrick Lightbody,
Your message is awaiting moderation. Thank you for participating in the discussion.
Clinton,
You're probably right, but we can hope :) I love iBatis - I hope you don't take my comment the wrong way. I'd love to see something like that (like parts of what JDBC 4.0 seems to offer) built in to the JDK.
Re: I wish.
by Cameron Purdy,
Your message is awaiting moderation. Thank you for participating in the discussion.
JDBC's verboseness never bothered me .. the problems that bothered me were its lack of support for the full set of ANSI SQL "1992" types (let alone more contemporary standards!), e.g. date/time intervals, etc.
I always figure that low level specs are a pain because they attempt to solve the 98/2 principle, which is why things like Spring or iBatis are handy for solving the 80/20 principle.
Peace,
Cameron Purdy
Tangosol Coherence: The Java Data Grid
Re: I wish.
by Javier Pavier,
Your message is awaiting moderation. Thank you for participating in the discussion.
... and if the lack of support in the spec wasn't bad enough, what are worse are the appalling attempts at JDBC drivers in existence (many methods "not implemented", returning extremely dubious interpretations of the spec (failing in the spec for not being specific), or using custom types to try to lock you into their own RDBMS).