Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
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 doing Class.forName("foo.bah.Driver").
Method Summary | |
boolean | acceptsURL(String url)
|
Connection | connect(String url,
Properties info)
|
int | getMajorVersion()
|
int | getMinorVersion()
|
DriverPropertyInfo[] | getPropertyInfo(String url,
Properties info)
The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database. |
boolean | jdbcCompliant()
|
Method Detail |
public Connection connect(String url, Properties info) throws SQLException
The driver should raise a SQLException if it is the right driver to connect to the given URL, but has trouble connecting to the database.
The java.util.Properties argument can be used to passed arbitrary string tag/value pairs as connection arguments. Normally at least "user" and "password" properties should be included in the Properties.
url
- The URL of the database to connect to
info
- a list of arbitrary string tag/value pairs as
connection arguments; normally at least a "user" and
"password" property should be included
public boolean acceptsURL(String url) throws SQLException
url
- The URL of the database.
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database. Note that depending on the values the human has supplied so far, additional values may become necessary, so it may be necessary to iterate though several calls to getPropertyInfo.
url
- The URL of the database to connect to.
info
- A proposed list of tag/value pairs that will be sent on
connect open.
public int getMajorVersion()
public int getMinorVersion()
public boolean jdbcCompliant()
Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |