JDBC 3.0 Offers Database Control
JDBC 3.0 Offers Database Control
.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 email@example.com.
Connect JDBC 3
Connect JDBC 3.0
The state-of-the-art database-to-XML conversion tools in this package from DataDirect will be valuable assets to those working with XML, and the new connection pooling features will help those now using low-end application servers to avoid upgrading to more expensive options just to gain this feature.
SHORT-TERM BUSINESS IMPACT // Graphical tools to extract database data in XML form are easy to use and will speed XML database projects.
LONG-TERM BUSINESS IMPACT // Support for Java Database Connectivity 3.0 features, such as updatable binary large objects and prepared statement pooling, will allow for higher performance and more sophisticated applications.
PROS // XML data query tool is full-featured and easy to use; JDBC drivers available for all major databases; support for many JDBC 3.0 features.
CONS // Competes with free products that are good enough in many cases; doesnt support DB2/400 databases; some bugs in the XML query tool; may require client-side installation, which raises deployment costs significantly.
DataDirect Technologies Inc., Rockville, Md.; (800) 876-3101; www.datadirect-technologies.com/jdbc/connectjdbc/jpxconnectjdbc.asp