By Timothy Dyck  |  Posted 2002-04-08 Print this article Print

.0 Offers Database Control"> In mid-February, Sun Microsystems Inc. released the latest version, 3.0, of the JDBC API specification, defining how Java applications access relational databases.

The core Java Database Connectivity 3.0 libraries are included in Java 2 Standard Edition 1.4, so installing a Java 1.4-compliant Java virtual machine is the easiest way to get JDBC 3.0. In addition, a JDBC 3.0-compliant database driver is needed. We expect database vendors to also start providing JDBC 3.0-compliant drivers with their products this year.

JDBC is a mature database access standard now, and the 3.0 version of the specification doesnt introduce any changes as large as those in JDBC 2.0. The focus now is on incremental improvements that provide new Java APIs to handle more specialized database objects and operations.

These changes are most welcome in two areas: handling auto-incrementing column values and large objects.

Server databases commonly provide ways (unfortunately, using vendor-specific syntax) to have the value in a numeric column automatically generated when a new row is inserted. A new GetGeneratedKeys method of a JDBC Statement object returns a result set object containing what the values of these columns were. This means that applications dont have to use vendor-specific functions to get this data and so will be more portable.

Character large objects, or CLOBs, (necessary when storing large text objects, such as full-text articles or long product descriptions) and binary large objects, or BLOBs (used to store binary data such as pictures), also have much better support in JDBC 3.0. The specification now provides ways to update both of these large object types, making it simpler to build Java-based content management applications.

A new transaction savepoint interface provides a way to create, release or roll back to particular transaction savepoints (partially committed transactions) if the database itself supports savepoints.

Java programs that need to process large volumes of transactions will benefit from JDBC 3.0s ability to place prepared statements into a pool for reuse (previously, only connections could be pooled, not statements). There are also new metadata calls that applications can use to find out parameter information such as the number of parameters and their types for particular prepared statements.

West Coast Technical Director Timothy Dyck can be reached at timothy_dyck@ziffdavis.com.

Timothy Dyck is a Senior Analyst with eWEEK Labs. He has been testing and reviewing application server, database and middleware products and technologies for eWEEK since 1996. Prior to joining eWEEK, he worked at the LAN and WAN network operations center for a large telecommunications firm, in operating systems and development tools technical marketing for a large software company and in the IT department at a government agency. He has an honors bachelors degree of mathematics in computer science from the University of Waterloo in Waterloo, Ontario, Canada, and a masters of arts degree in journalism from the University of Western Ontario in London, Ontario, Canada.

Submit a Comment

Loading Comments...
Manage your Newsletters: Login   Register My Newsletters

Rocket Fuel