com.taosdata.jdbc

## 类 TSDBJNIConnector

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

直接已知子类:
  TMQConnector

    public class TSDBJNIConnector
    extends Object

JNI connector

### 字段概要

字段
`protected long` `taos`

### 构造器概要

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

### 方法概要

所有方法 静态方法 实例方法 具体方法
`void` `addBatch(long stmt)`
`void` `bindColumnDataArray(long stmt, ByteBuffer colDataList, ByteBuffer lengthList, ByteBuffer isNullList, int type, int bytes, int numOfRows, int columnIndex)`
`void` `closeBatch(long stmt)`
`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)`
`void` `executeBatch(long stmt)`
`long` `executeQuery(String sql)` Execute DML/DDL operation
`long` `executeQuery(String sql, Long reqId)`
`int` `fetchBlock(long resultSet, TSDBResultSetBlockData blockData)`
`int` `fetchRow(long resultSet, TSDBResultSetRowData rowData)` Get one row data
`int` `freeResultSet(long pSql)` Free result set operation from C to release result set 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` `getResultTimePrecision(long sqlObj)` Get Result Time Precision.
`int` `getSchemaMetaData(long resultSet, List<ColumnMetaData> columnMetaData)` Get schema metadata
`int` `getTableVGroupID(String db, String table)` VGroupID
`static void` `init(Properties props)`
`void` `insertLines(String[] lines, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType)`
`void` `insertLinesWithReqId(String[] lines, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType, long reqId)`
`void` `insertLinesWithTtl(String[] lines, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType, int ttl)`
`void` `insertLinesWithTtlAndReqId(String[] lines, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType, int ttl, long reqId)`
`int` `insertRaw(String line, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType)`
`int` `insertRawWithReqId(String line, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType, long reqId)`
`int` `insertRawWithTtl(String line, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType, int ttl)`
`int` `insertRawWithTtlAndReqId(String line, SchemalessProtocolType protocolType, SchemalessTimestampType timestampType, int ttl, long reqId)`
`boolean` `isClosed()`
`boolean` `isResultsetClosed()`
`boolean` `isUpdateQuery(long pSql)`
`long` `prepareStmt(String sql)`
`long` `prepareStmt(String sql, Long reqId)`
`void` `setBindTableName(long stmt, String tableName)`
`void` `setBindTableNameAndTags(long stmt, String tableName, int numOfTags, ByteBuffer tags, ByteBuffer typeList, ByteBuffer lengthList, ByteBuffer nullList)`

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

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

### 字段详细资料

#### taos

    protected long taos

### 构造器详细资料

#### TSDBJNIConnector

    public TSDBJNIConnector()

### 方法详细资料

#### init

    public static void init(Properties props)
                     throws SQLWarning

抛出:
  `SQLWarning`

#### 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`

#### executeQuery

    public long executeQuery(String sql,
                             Long reqId)
                      throws SQLException

抛出:
  `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)

#### isClosed

    public boolean isClosed()

#### isResultsetClosed

    public boolean isResultsetClosed()

#### freeResultSet

    public int freeResultSet(long pSql)

Free result set operation from C to release result set 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)

#### getResultTimePrecision

    public int getResultTimePrecision(long sqlObj)

Get Result Time Precision.

返回:
  0: ms, 1: us, 2: ns

#### closeConnection

    public void closeConnection()
                         throws SQLException

Execute close operation from C to release connection pointer by JNI

抛出:
  `SQLException`

#### prepareStmt

    public long prepareStmt(String sql)
                     throws SQLException

抛出:
  `SQLException`

#### prepareStmt

    public long prepareStmt(String sql,
                            Long reqId)
                     throws SQLException

抛出:
  `SQLException`

#### setBindTableName

    public void setBindTableName(long stmt,
                                 String tableName)
                          throws SQLException

抛出:
  `SQLException`

#### setBindTableNameAndTags

    public void setBindTableNameAndTags(long stmt,
                                        String tableName,
                                        int numOfTags,
                                        ByteBuffer tags,
                                        ByteBuffer typeList,
                                        ByteBuffer lengthList,
                                        ByteBuffer nullList)
                                 throws SQLException

抛出:
  `SQLException`

#### bindColumnDataArray

    public void bindColumnDataArray(long stmt,
                                    ByteBuffer colDataList,
                                    ByteBuffer lengthList,
                                    ByteBuffer isNullList,
                                    int type,
                                    int bytes,
                                    int numOfRows,
                                    int columnIndex)
                             throws SQLException

抛出:
  `SQLException`

#### executeBatch

    public void executeBatch(long stmt)
                      throws SQLException

抛出:
  `SQLException`

#### addBatch

    public void addBatch(long stmt)
                  throws SQLException

抛出:
  `SQLException`

#### closeBatch

    public void closeBatch(long stmt)
                    throws SQLException

抛出:
  `SQLException`

#### insertLines

    public void insertLines(String[] lines,
                            SchemalessProtocolType protocolType,
                            SchemalessTimestampType timestampType)
                     throws SQLException

抛出:
  `SQLException`

#### insertLinesWithReqId

    public void insertLinesWithReqId(String[] lines,
                                     SchemalessProtocolType protocolType,
                                     SchemalessTimestampType timestampType,
                                     long reqId)
                              throws SQLException

抛出:
  `SQLException`

#### insertLinesWithTtl

    public void insertLinesWithTtl(String[] lines,
                                   SchemalessProtocolType protocolType,
                                   SchemalessTimestampType timestampType,
                                   int ttl)
                            throws SQLException

抛出:
  `SQLException`

#### insertLinesWithTtlAndReqId

    public void insertLinesWithTtlAndReqId(String[] lines,
                                           SchemalessProtocolType protocolType,
                                           SchemalessTimestampType timestampType,
                                           int ttl,
                                           long reqId)
                                    throws SQLException

抛出:
  `SQLException`

#### insertRaw

    public int insertRaw(String line,
                         SchemalessProtocolType protocolType,
                         SchemalessTimestampType timestampType)
                  throws SQLException

抛出:
  `SQLException`

#### insertRawWithReqId

    public int insertRawWithReqId(String line,
                                  SchemalessProtocolType protocolType,
                                  SchemalessTimestampType timestampType,
                                  long reqId)
                           throws SQLException

抛出:
  `SQLException`

#### insertRawWithTtl

    public int insertRawWithTtl(String line,
                                SchemalessProtocolType protocolType,
                                SchemalessTimestampType timestampType,
                                int ttl)
                         throws SQLException

抛出:
  `SQLException`

#### insertRawWithTtlAndReqId

    public int insertRawWithTtlAndReqId(String line,
                                        SchemalessProtocolType protocolType,
                                        SchemalessTimestampType timestampType,
                                        int ttl,
                                        long reqId)
                                 throws SQLException

抛出:
  `SQLException`

#### getTableVGroupID

    public int getTableVGroupID(String db,
                                String table)
                         throws SQLException

VGroupID

抛出:
  `SQLException`