com.taosdata.jdbc

## Class TSDBDriver

- java.lang.Object
- - com.taosdata.jdbc.AbstractDriver
  - - com.taosdata.jdbc.TSDBDriver

All Implemented Interfaces:
  Driver

    public class TSDBDriver
    extends AbstractDriver

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 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")

### Field Summary

Fields
`static String` `PROPERTY_KEY_BATCH_ERROR_IGNORE` continue process commands in executeBatch
`static String` `PROPERTY_KEY_BATCH_LOAD` fetch data from native function in a batch model
`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_PRODUCT_NAME` PRODUCT_NAME
`static String` `PROPERTY_KEY_TIME_ZONE` Key for the timezone used by the TSDB client in properties instance
`static String` `PROPERTY_KEY_TIMESTAMP_FORMAT` timestamp format for JDBC-RESTful,should one of the options: string or timestamp or utc
`static String` `PROPERTY_KEY_USER` Key used to retrieve the user value from the properties instance passed to the driver.

### Constructor Summary

Constructors
Constructor and Description
`TSDBDriver()`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `acceptsURL(String url)`
`Connection` `connect(String url, Properties info)`
`int` `getMajorVersion()`
`int` `getMinorVersion()`
`Logger` `getParentLogger()`
`DriverPropertyInfo[]` `getPropertyInfo(String url, Properties info)`
`boolean` `jdbcCompliant()`
`Properties` `parseURL(String url, Properties defaults)` example: jdbc:TAOS://127.0.0.1:0/db?user=root&password=your_password

### Methods inherited from class com.taosdata.jdbc.AbstractDriver

`getPropertyInfo`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### PROPERTY_KEY_PRODUCT_NAME

    public static final String PROPERTY_KEY_PRODUCT_NAME

PRODUCT_NAME

See Also:
  Constant Field Values

#### PROPERTY_KEY_HOST

    public static final String PROPERTY_KEY_HOST

Key used to retrieve the host value from the properties instance passed to the driver.

See Also:
  Constant Field Values

#### PROPERTY_KEY_PORT

    public static final String PROPERTY_KEY_PORT

Key used to retrieve the port number value from the properties instance passed to the driver.

See Also:
  Constant Field Values

#### PROPERTY_KEY_DBNAME

    public static final String PROPERTY_KEY_DBNAME

Key used to retrieve the database value from the properties instance passed to the driver.

See Also:
  Constant Field Values

#### PROPERTY_KEY_USER

    public static final String PROPERTY_KEY_USER

Key used to retrieve the user value from the properties instance passed to the driver.

See Also:
  Constant Field Values

#### PROPERTY_KEY_PASSWORD

    public static final String PROPERTY_KEY_PASSWORD

Key used to retrieve the password value from the properties instance passed to the driver.

See Also:
  Constant Field Values

#### PROPERTY_KEY_CONFIG_DIR

    public static final String PROPERTY_KEY_CONFIG_DIR

Key for the configuration file directory of TSDB client in properties instance

See Also:
  Constant Field Values

#### PROPERTY_KEY_TIME_ZONE

    public static final String PROPERTY_KEY_TIME_ZONE

Key for the timezone used by the TSDB client in properties instance

See Also:
  Constant Field Values

#### PROPERTY_KEY_LOCALE

    public static final String PROPERTY_KEY_LOCALE

Key for the locale used by the TSDB client in properties instance

See Also:
  Constant Field Values

#### PROPERTY_KEY_CHARSET

    public static final String PROPERTY_KEY_CHARSET

Key for the char encoding used by the TSDB client in properties instance

See Also:
  Constant Field Values

#### PROPERTY_KEY_BATCH_LOAD

    public static final String PROPERTY_KEY_BATCH_LOAD

fetch data from native function in a batch model

See Also:
  Constant Field Values

#### PROPERTY_KEY_TIMESTAMP_FORMAT

    public static final String PROPERTY_KEY_TIMESTAMP_FORMAT

timestamp format for JDBC-RESTful,should one of the options: string or timestamp or utc

See Also:
  Constant Field Values

#### PROPERTY_KEY_BATCH_ERROR_IGNORE

    public static final String PROPERTY_KEY_BATCH_ERROR_IGNORE

continue process commands in executeBatch

See Also:
  Constant Field Values

### Constructor Detail

#### TSDBDriver

    public TSDBDriver()

### Method Detail

#### connect

    public Connection connect(String url,
                              Properties info)
                       throws SQLException

Throws:
  `SQLException`

#### acceptsURL

    public boolean acceptsURL(String url)
                       throws SQLException

Parameters:
  `url` - the URL of the database
Returns:
  `true` if this driver understands the given URL; `false` otherwise
Throws:
  `SQLException` - if a database access error occurs or the url is `null`

#### getPropertyInfo

    public DriverPropertyInfo[] getPropertyInfo(String url,
                                                Properties info)
                                         throws SQLException

Throws:
  `SQLException`

#### parseURL

    public Properties parseURL(String url,
                               Properties defaults)

example: jdbc:TAOS://127.0.0.1:0/db?user=root&password=your_password

Overrides:
  `parseURL` in class `AbstractDriver`

#### getMajorVersion

    public int getMajorVersion()

#### getMinorVersion

    public int getMinorVersion()

#### jdbcCompliant

    public boolean jdbcCompliant()

#### getParentLogger

    public Logger getParentLogger()