Contents | Prev | Next JDBCTM Guide: Getting Started


3 Overview of New Features

This chapter contains an overview of the new features that are being added to the JDBC API.

3.1     Result set enhancements

The JDBC 1.0 API provided result sets that had the ability to scroll in a forward direction only. Scrollable result sets allow for more flexibility in the processing of results by providing both forward and backward movement through their contents. In addition, scrollable result sets allow for relative and absolute positioning. For example, it's possible to move to the fourth row in a scrollable result set directly, or to move directly to the third row following the current row, provided the row exists.

The JDBC API allows result sets to be directly updatable, as well.

3.2     Batch updates

The batch update feature allows an application to submit multiple update statements (insert/update/delete) in a single request to the database. This can provide a dramatic increase in performance when a large number of update statements need to be executed.

3.3     Advanced data types

Increased support for storing persistent Java programming language objects (Java objects ) and a mapping for SQL99 data types such as binary large objects, and structured types, has been added to the JDBC API. An application may also customize the mapping of SQL99 structured types into Java programming language classes.

3.4     Rowsets

As its name implies, a rowset encapsulates a set of rows. A rowset may or may not maintain an open database connection. When a rowset is `disconnected' from its data source, updates performed on the rowset are propagated to the underlying database using an optimistic concurrency control algorithm.

Rowsets add support to the JDBC API for the JavaBeans component model. A rowset object is a bean. A rowset implementation may be serializable. Rowsets can be created at design time and used in conjunction with other JavaBeans components in a visual builder tool to construct an application.

3.5     JNDI for naming databases

The Java Naming and Directory Interface (JNDI) API can be used in addition to a JDBC technology-based driver manager (JDBC driver manager) to obtain a connection to a database. When an application uses the JNDI API, it specifies a logical name that identifies a particular database instance and JDBC driver for accessing that database. This has the advantage of making the application code independent of a particular JDBC driver and JDBC technology URL.

3.6     Connection Pooling

The JDBC API contains `hooks' that allow connection pooling to be implemented on top of the JDBC driver layer. This allows for a single connection cache that spans the different JDBC drivers that may be in use. Since creating and destroying database connections is expensive, connection pooling is important for achieving good performance, especially for server applications.

3.7     Distributed transaction support

Support for distributed transactions has been added as an extension to the JDBC API. This feature allows a JDBC driver to support the standard 2-phase commit protocol used by the Java Transaction Service (JTS) API.

3.8     Other new features

Support for character streams has been added. This means that character data can be retrieved and sent to the database as a stream of internationalized Unicode characters. Methods to allow java.math.BigDecimal values to be returned with full precision have also been added. Support for time zones has been added.



Contents | Prev | Next
jdbc@eng.sun.com or jdbc-business@eng.sun.com
Copyright © 1996-1999 Sun Microsystems, Inc. All rights reserved.