Name
Driver
Synopsis
Interface Name:
java.sql.Driver
Superclass: None
Immediate Subclasses: None
Interfaces Implemented: None
Availability: JDK 1.1
Description
This class represents a specific JDBC implementation. When a
Driver is loaded, it should create an instance of
itself and register that instance with the
DriverManager class. This action allows
applications to create instances of it using the
Class.forName( ) call to load a driver.
The Driver object then provides the ability for an
application to connect to one or more databases. When a request for a
specific database comes through, the DriverManager
passes the data source request to each Driver
registered as a URL. The first Driver to connect
to the data source using that URL will be used.
Class Summary
public interface Driver {
boolean acceptsURL(String url) throws SQLException;
Connection connect(String url, Properties info)
throws SQLException;
int getMajorVersion( );
int getMinorVersion( );
DriverPropertyInfo[] getPropertyInfo(String url,
Properties info)
throws SQLException;
boolean jdbcCompliant( );
}Object Methods
acceptsURL( )
public boolean acceptsURL(String url) throws SQLException
- Description
This method returns
trueif the specified URL matches the URL subprotocol used by this driver.
connect( )
public Connection connect(String url, Properties info)
throws SQLException- Description
This method attempts a connect using the specified URL and
Propertyinformation (usually containing the username and password). If the URL is not right ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access