public class NonRegisteringDriver
extends java.lang.Object
implements java.sql.Driver
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.bar.Driver").
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
acceptAwsProtocolOnly |
| Constructor and Description |
|---|
NonRegisteringDriver()
Construct a new driver and register it with DriverManager.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptsURL(java.lang.String url)
Typically, drivers will return true if they understand the subprotocol specified in the URL and false if they don't.
|
java.sql.Connection |
connect(java.lang.String url,
java.util.Properties info)
Try to make a database connection to the given URL.
|
int |
getMajorVersion() |
int |
getMinorVersion() |
static java.lang.String |
getOSName()
Standardizes OS name information to align with other drivers/clients for MySQL connection attributes.
|
java.util.logging.Logger |
getParentLogger() |
static java.lang.String |
getPlatform()
Standardizes platform information to align with other drivers/clients for MySQL connection attributes.
|
java.sql.DriverPropertyInfo[] |
getPropertyInfo(java.lang.String url,
java.util.Properties info) |
boolean |
jdbcCompliant() |
public NonRegisteringDriver()
throws java.sql.SQLException
java.sql.SQLException - if a database error occurs.public static java.lang.String getOSName()
public static java.lang.String getPlatform()
public boolean acceptsURL(java.lang.String url)
acceptsURL in interface java.sql.Driverurl - the URL of the driver.java.sql.SQLException - if a database access error occurs or the url is null.public java.sql.Connection connect(java.lang.String url,
java.util.Properties info)
throws java.sql.SQLException
The driver should raise an SQLException if the URL is null or 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 pass arbitrary string tag/value pairs as connection arguments. These properties take precedence over any properties sent in the URL.
MySQL protocol takes the form: jdbc:mysql://host:port/database.
connect in interface java.sql.Driverurl - the URL of the database to connect to.info - a list of arbitrary tag/value pairs as connection arguments.java.sql.SQLException - if a database access error occurs or the url is null.public int getMajorVersion()
getMajorVersion in interface java.sql.Driverpublic int getMinorVersion()
getMinorVersion in interface java.sql.Driverpublic java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
java.util.Properties info)
throws java.sql.SQLException
getPropertyInfo in interface java.sql.Driverjava.sql.SQLExceptionpublic boolean jdbcCompliant()
jdbcCompliant in interface java.sql.Driverpublic java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface java.sql.Driverjava.sql.SQLFeatureNotSupportedException