java.sql.Driver is a database driver interface.
Description
java.sql.Driver is an interface that each driver must implement.
The Java SQL framework allows multiple database drivers. Each driver should provide a class that implements the driver interface.
DriverManager will try to load as many drivers as possible, and then ask each driver in turn to try to connect to the target URL for any specified connection request.
We strongly recommend that each driver class be small and independent so that supporting code is not massively introduced when the driver classes are loaded and queried.
When a driver class is loaded, it should create an instance of its own and register the instance with DriverManager. You can load and register drivers by calling the following method:
Class.forName("foo.bah.Driver")
OceanBase Connector/J can create DriverAction to receive notifications when DriverManager.deregisterDriver(java.sql.Driver) is called.
Methods
| Method | Return type | Supported in Oracle mode? | Supported in MySQL mode? |
|---|---|---|---|
| connect(String url,java.util.Properties info) | Connection | Yes | Yes |
| acceptsURL(String url) | Boolean | Yes | Yes |
| getPropertyInfo(String url,java.util.Properties info) | DriverPropertyInfo[] | Yes | Yes |
| getMajorVersion() | int | Yes | Yes |
| getMinorVersion() | int | Yes | Yes |
| jdbcCompliant() | Boolean | Yes | Yes |
| getParentLogger() | Logger | No | No |