public class TSDBDriver extends Object implements 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 stand alone 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")
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
HOST_NAME_INDEX
Index for host coming out of parseHostPortPair().
|
static int |
PORT_NUMBER_INDEX
Index for port coming out of parseHostPortPair().
|
static String |
PROPERTY_KEY_CHARSET
Key for the char encoding used by the TSDB client in properties instance
|
static String |
PROPERTY_KEY_CONFIG_DIR
Key for the configuration file directory of TSDB client in properties instance
|
static String |
PROPERTY_KEY_DBNAME
Key used to retrieve the database value from the properties instance passed
to the driver.
|
static String |
PROPERTY_KEY_HOST
Key used to retrieve the host value from the properties instance passed to
the driver.
|
static String |
PROPERTY_KEY_LOCALE
Key for the locale used by the TSDB client in properties instance
|
static String |
PROPERTY_KEY_PASSWORD
Key used to retrieve the password value from the properties instance passed
to the driver.
|
static String |
PROPERTY_KEY_PORT
Key used to retrieve the port number value from the properties instance
passed to the driver.
|
static String |
PROPERTY_KEY_PROTOCOL |
static String |
PROPERTY_KEY_TIME_ZONE
Key for the timezone used by the TSDB client in properties instance
|
static String |
PROPERTY_KEY_USER
Key used to retrieve the user value from the properties instance passed to
the driver.
|
| 构造器和说明 |
|---|
TSDBDriver() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
acceptsURL(String url) |
Connection |
connect(String url,
Properties info) |
String |
database(Properties props)
Returns the database property from
props |
int |
getMajorVersion() |
int |
getMinorVersion() |
Logger |
getParentLogger() |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info) |
String |
host(Properties props)
Returns the host property
|
boolean |
jdbcCompliant() |
protected static String[] |
parseHostPortPair(String hostPortPair)
Parses hostPortPair in the form of [host][:port] into an array, with the
element of index HOST_NAME_INDEX being the host (or null if not specified),
and the element of index PORT_NUMBER_INDEX being the port (or null if not
specified).
|
Properties |
parseURL(String url,
Properties defaults)
example: jdbc:TSDB://127.0.0.1:0/db?
|
int |
port(Properties props)
Returns the port number property
|
void |
setPropertyValue(Properties property,
String[] keyValuePair) |
public static final String PROPERTY_KEY_DBNAME
public static final String PROPERTY_KEY_HOST
public static final String PROPERTY_KEY_PASSWORD
public static final String PROPERTY_KEY_PORT
public static final String PROPERTY_KEY_USER
public static final String PROPERTY_KEY_CONFIG_DIR
public static final String PROPERTY_KEY_TIME_ZONE
public static final String PROPERTY_KEY_LOCALE
public static final String PROPERTY_KEY_CHARSET
public static final int PORT_NUMBER_INDEX
public static final int HOST_NAME_INDEX
public Connection connect(String url, Properties info) throws SQLException
connect 在接口中 DriverSQLExceptionprotected static String[] parseHostPortPair(String hostPortPair) throws SQLException
hostPortPair - host and port in form of of [host][:port]SQLException - if a parse error occurspublic boolean acceptsURL(String url) throws SQLException
acceptsURL 在接口中 DriverSQLExceptionpublic DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo 在接口中 DriverSQLExceptionpublic Properties parseURL(String url, Properties defaults) throws SQLException
SQLExceptionpublic void setPropertyValue(Properties property, String[] keyValuePair)
public int getMajorVersion()
getMajorVersion 在接口中 Driverpublic int getMinorVersion()
getMinorVersion 在接口中 Driverpublic boolean jdbcCompliant()
jdbcCompliant 在接口中 Driverpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger 在接口中 DriverSQLFeatureNotSupportedExceptionpublic String host(Properties props)
props - the java.util.Properties instance to retrieve the hostname from.public int port(Properties props)
props - the properties to get the port number frompublic String database(Properties props)
propsprops - the Properties to look for the database property.Copyright © 2020. All rights reserved.