com.taosdata.jdbc

## 类 TSDBJNIConnector

- java.lang.Object
- - com.taosdata.jdbc.TSDBJNIConnector

    public class TSDBJNIConnector
    extends Object

JNI connector

### 构造器概要

构造器
构造器和说明
`TSDBJNIConnector()`

### 方法概要

所有方法 静态方法 实例方法 具体方法
`void` `closeConnection()` Execute close operation from C to release connection pointer by JNI
`boolean` `connect(String host, int port, String dbName, String user, String password)`
`long` `executeQuery(String sql)` Execute DML/DDL operation
`int` `fetchBlock(long resultSet, TSDBResultSetBlockData blockData)`
`int` `fetchRow(long resultSet, TSDBResultSetRowData rowData)` Get one row data
`int` `freeResultSet(long pSql)` Free resultset operation from C to release resultset pointer by JNI
`int` `getAffectedRows(long pSql)` Get affected rows count
`int` `getErrCode(long pSql)` Get recent error code by connection
`String` `getErrMsg(long pSql)` Get recent error message by connection
`int` `getSchemaMetaData(long resultSet, List<ColumnMetaData> columnMetaData)` Get schema metadata
`static String` `getTsCharset()`
`static void` `init(String configDir, String locale, String charset, String timezone)`
`static void` `initImp(String configDir)`
`boolean` `isClosed()`
`boolean` `isResultsetClosed()`
`boolean` `isUpdateQuery(long pSql)`
`static int` `setOptions(int optionIndex, String optionValue)`
`boolean` `validateCreateTableSql(String sql)` Validate if a create table sql statement is correct without actually creating that table

### 从类继承的方法 java.lang.Object

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

### 构造器详细资料

#### TSDBJNIConnector

    public TSDBJNIConnector()

### 方法详细资料

#### isClosed

    public boolean isClosed()

#### isResultsetClosed

    public boolean isResultsetClosed()

#### init

    public static void init(String configDir,
                            String locale,
                            String charset,
                            String timezone)
                     throws SQLWarning

抛出:
  `SQLWarning`

#### initImp

    public static void initImp(String configDir)

#### setOptions

    public static int setOptions(int optionIndex,
                                 String optionValue)

#### getTsCharset

    public static String getTsCharset()

#### connect

    public boolean connect(String host,
                           int port,
                           String dbName,
                           String user,
                           String password)
                    throws SQLException

抛出:
  `SQLException`

#### executeQuery

    public long executeQuery(String sql)
                      throws SQLException

Execute DML/DDL operation

抛出:
  `SQLException`

#### getErrCode

    public int getErrCode(long pSql)

Get recent error code by connection

#### getErrMsg

    public String getErrMsg(long pSql)

Get recent error message by connection

#### isUpdateQuery

    public boolean isUpdateQuery(long pSql)

#### freeResultSet

    public int freeResultSet(long pSql)

Free resultset operation from C to release resultset pointer by JNI

#### getAffectedRows

    public int getAffectedRows(long pSql)

Get affected rows count

#### getSchemaMetaData

    public int getSchemaMetaData(long resultSet,
                                 List<ColumnMetaData> columnMetaData)

Get schema metadata

#### fetchRow

    public int fetchRow(long resultSet,
                        TSDBResultSetRowData rowData)

Get one row data

#### fetchBlock

    public int fetchBlock(long resultSet,
                          TSDBResultSetBlockData blockData)

#### closeConnection

    public void closeConnection()
                         throws SQLException

Execute close operation from C to release connection pointer by JNI

抛出:
  `SQLException`

#### validateCreateTableSql

    public boolean validateCreateTableSql(String sql)

Validate if a create table sql statement is correct without actually creating that table