Java Reference
In-Depth Information
Another major difference is that many database management systems offer a lot of
advanced functionality that SQL standards do not cover. These advanced features
may be implemented in ways that are not consistent across different database
systems. A very important design requirement of the JDBC API is that it must support
SQL as it is rather than as the standards define it.
One way the JDBC API deals with this problem is by allowing any SQL String to be
passed to an underlying DBMS driver. This feature means that an application is free
to use whatever functionality a given DBMS might offer. The corollary is that some
database management systems return an error response to some commands.
The JDBC API supports this ability to pass any SQL String to a database
management system through an escape mechanism that provides a standard JDBC
syntax for several of the more common areas of SQL divergence. For example, there
are escapes for date literals and for stored procedure calls.
An additional support mechanism is provided by way of the DatabaseMetaData
interface, which provides descriptive information about the DBMS. This is especially
useful in cross-platform applications, where it can help you to adapt your application
to the requirements and capabilities of different database management systems.
Just as there are variations in the implementation of the SQL standard, there can be
variations in the level of a JDBC driver's compliance to the definition of the API. The
concept of JDBC compliance is discussed in the next section .
JDBC Compliance
Sun created the "JDBC COMPLIANT TM " designation to indicate that you can rely on a
vendor's JDBC implementation to conform to a standard level of JDBC functionality.
Before a vendor can use this designation, the vendor's driver must pass Sun's JDBC
conformance tests. These conformance tests check for the existence of all of the
classes and methods defined in the JDBC API, and, as far as possible, they check
that the SQL Entry Level functionality is available.
The java.sql.Driver method jdbcCompliant() reports whether the driver is JDBC
Compliant. A driver may only report "true" when this method is called if it passes the
JDBC compliance tests; otherwise, it is required to return false. This method is not
intended to encourage the development of non-JDBC compliant drivers. It exists
merely in recognition of the fact that some vendors are interested in using the JDBC
API and framework for lightweight databases that do not support full database
functionality or for special databases such as document-information retrieval, where a
SQL implementation may not be feasible.
Sun defines the three following levels of JDBC compliance:
Search WWH ::




Custom Search