The Java SQL framework allows for multiple database drivers.
Each driver should supply a class that implements the Driver interface.
The DriverManager will try to load as many drivers as it can find and then for any given connection request, it will ask each driver in turn to try to connect to the target URL.
It is strongly recommended that each Driver class should be small and standalone so that the Driver class can be loaded and queried without bringing in vast quantities of supporting code.
When a Driver class is loaded, it should create an instance of itself and register it with the DriverManager. This means that a user can load and register a driver by calling
|Method from java.sql.Driver Summary:|
|acceptsURL, connect, getMajorVersion, getMinorVersion, getParentLogger, getPropertyInfo, jdbcCompliant|
|Method from java.sql.Driver Detail:|
public boolean acceptsURL(String url) throws SQLException
public Connection connect(String url, Properties info) throws SQLException
The driver should throw an
public int getMajorVersion()
public int getMinorVersion()
public Logger getParentLogger() throws SQLFeatureNotSupportedException
public DriverPropertyInfo getPropertyInfo(String url, Properties info) throws SQLException
public boolean jdbcCompliant()
JDBC compliance requires full support for the JDBC API and full support for SQL 92 Entry Level. It is expected that JDBC compliant drivers will be available for all the major commercial databases.
This method is not intended to encourage the development of non-JDBC compliant drivers, but is a 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.