But JDBC is more than a background player in database connectivity.The more you know about it, the more efficient your RDBMS interactions will be.By commenting, you are accepting the IBM commenting guidelines and the DISQUS terms of service.Many Java developers today know the Java Database Connectivity (JDBC) API by way of a data-access platform such as Hibernate or Spring.In this installment, I'll demonstrate several features introduced in recent versions of JDBC.
Finally, a sample JDBC servlet using the My SQL database will be presented.This whole operation is so common that is has become almost sacred: it's done that way simply because that's the way it's done. Many developers are unaware of the fact that JDBC has been considerably enhanced over the years, even though those enhancements are reflected in new version numbers and releases. One of the interesting (though frequently ignored) enhancements is the ability to "scroll" through the Statement stmt = con.create Statement( Result Set. CONCUR_UPDATABLE); Result Set scrolling RS = stmt.execute Query("SELECT * FROM lineitem WHERE id=1"); scrolling RS.first(); scrolling RS.udpate Float("PRICE", 121.45f); // ...if (user Said OK) scrolling RS.update Row(); else scrolling RS.cancel Row Updates();s and disconnected access? Keeping database connections to a minimum is key to supporting the massive numbers of users that the Internet can bring to a company's web site.But beyond that, trying to modify values returned by SQL can be tricky — and trying to get the current date and time from the database could drive even the most patient JDBC developer mad (and potentially bald, too). The fact is, most developers scratch the surface of the Java platform, learning just enough to get the job done.In this series, Ted Neward digs beneath the core functionality of the Java platform to uncover little-known facts that could help you solve even the stickiest programming challenges.