public class Driver extends Object implements Driver, JdbcDriverBackwardsCompat
Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection(
"jdbc:h2:˜/test", "sa", "sa");
| 构造器和说明 |
|---|
Driver() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
acceptsURL(String url)
Check if the driver understands this URL.
|
Connection |
connect(String url,
Properties info)
Open a database connection.
|
int |
getMajorVersion()
Get the major version number of the driver.
|
int |
getMinorVersion()
Get the minor version number of the driver.
|
Logger |
getParentLogger()
[Not supported]
|
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info)
Get the list of supported properties.
|
boolean |
jdbcCompliant()
Check if this driver is compliant to the JDBC specification.
|
static Driver |
load()
INTERNAL
|
static void |
setDefaultConnection(Connection c)
INTERNAL
Sets, on a per-thread basis, the default-connection for
user-defined functions.
|
static void |
setThreadContextClassLoader(Thread thread)
INTERNAL
|
static void |
unload()
INTERNAL
|
public Connection connect(String url, Properties info) throws SQLException
connect 在接口中 Driverurl - the database URLinfo - the connection propertiesSQLException - on connection exception or if URL is nullpublic boolean acceptsURL(String url) throws SQLException
acceptsURL 在接口中 Driverurl - the database URLSQLException - if URL is nullpublic int getMajorVersion()
getMajorVersion 在接口中 Driverpublic int getMinorVersion()
getMinorVersion 在接口中 Driverpublic DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
getPropertyInfo 在接口中 Driverurl - the database URLinfo - the connection propertiespublic boolean jdbcCompliant()
jdbcCompliant 在接口中 Driverpublic Logger getParentLogger()
getParentLogger 在接口中 Driverpublic static Driver load()
public static void unload()
public static void setDefaultConnection(Connection c)
c - to set default topublic static void setThreadContextClassLoader(Thread thread)
thread - to set context class loader forCopyright © 2022. All rights reserved.