United States   Change   |   All Microsoft Sites

Home - SQL Server 2005

Java Database Connectivity (JDBC)

The SQL Server team announces the release of an updated Java Database Connectivity (JDBC) driver for use by both SQL Server 2000 and SQL Server 2005—the Microsoft SQL Server 2005 JDBC Driver. Based on the number of downloads, customer feedback, and usage of the SQL Server 2000 JDBC driver, the SQL Server team committed to provide enterprise-class JDBC connectivity and support for SQL Server, along with a long-term roadmap to ensure that the latest JDBC specification implementations were available to SQL Server customers as the specification evolved.

In addition, in a major update to the new driver, the SQL Server team announced an ISV-friendly licensing structure that enables the post-release version of the driver to be freely redistributable for all registered partners who are building applications on SQL Server.

The new driver includes a number of improvements including performance improvements that provide great optimization, transaction support to enable more scalable transactions, and deep support for the new SQL Server 2005 types. Visit the JDBC page on MSDN for the latest information.

Download the SQL Server 2005 JDBC Driver

The JDBC Driver is a Type 4 JDBC driver that provides database connectivity through the standard JDBC application program interfaces (APIs) available in J2EE.

Improved Performance

The new driver provides optimized server-side execution, an improved result-set cursor model, and transparency into generated row-identifiers.

In general, the new JDBC driver was designed specifically for SQL Server without any of the redundant conditional handling that is typically implemented in generic JDBC drivers, which are built to provide support for multiple databases. The design principles for this driver include optimized server-side executions, such as data-type conversions where possible, efficient and nonredundant copying of data from the server, and minimal calls to any java libraries that may prove to be expensive.

The use of inappropriate cursor types for result sets is often a developmental cause of poorly performing implementations that employ JDBC. The new driver includes improvements in both the performance and the flexibility of requesting and using cursors. The new driver explicitly exposes all SQL Server cursor types so that end users ultimately have the freedom to experiment and determine what works best for their specific data-access scenario. The customizable result set, fetch size, and fetch direction via the ResultSet.setFetchSize() and ResultSet.setFetchDirection() methods also provide additional flexibility and opportunities to optimize access to large result sets such as in scenarios where the application cannot leave the connection busy and it is undesirable to use multiple connections.

Scalable Transactions

The new driver provides transaction support for both local and distributed transactions and delivers a more scalable implementation through the use of newer interfaces and transaction timeouts.

Local transactions are supported through the standard application programming interfaces (APIs)—Connection.setAutoCommit(),Connection.commit(), Connection.rollback()—and can be managed explicitly by the application or by the J2EE application server.

The new JDBC driver supports distributed transactions under any Java Transaction API (JTA)-compliant transaction manager, and the streamlined implementation provides highly scalable distributed transaction support with the standard XA protocol (XA support). In addition, the driver seamlessly integrates with the Microsoft Distributed Transaction Coordinator (DTC) to provide distribution transaction support for both SQL Server 2000 and SQL Server 2005, including complete two-phase commit and recovery of distributed transactions. (DTC is a distributed transaction facility provided by Microsoft for Microsoft Windows systems.) The DTC implementation leverages the new transaction interface (IXATransLookup2) and provides improved performance through optimized thread management within SQL Server.

Finally, the new driver enables users to set limits on transaction execution times, thereby reducing the probability of indefinitely "hung" transactions that can cause unexpected blocking, leading to performance and administrative challenges.

SQL Server 2005 Feature Support

The new JDBC driver provides the basis for full SQL Server 2005 feature support in the future. Underlying this foundation is the use of the latest implementation of the native SQL Server data access protocol, also known as TDS 7.2. (SQL Server 2000 used TDS 7.1.) Using the latest native data-access protocol means that all the new SQL Server 2005 features can be exposed in the driver at the API level.

In the area of XML support, SQL Server 2000 provided basic support to marshal and unmarshal XML data to and from relational tables. SQL Server 2005 took this further by introducing a native XML data type, making XML a first-class citizen in the database, and allowing traditional data operations such as indexing and inline value updates to be done directly on XML data.

Finally, the new driver provides an improved data-type conversion/coercion scheme, allowing for better run-time predictability and a lower probability of data loss.

These improvements provide a better data-access experience for Java applications on SQL Server in performance, transactions, and SQL Server 2005 feature support.

The new driver is currently available as an independent download and will be updated on its own schedule, allowing for rapid iterations on releases with shorter development cycles, incorporation of community feedback, and up-to-date support for the latest JDBC specifications.