Package org.apache.druid.sql.avatica
Class AbstractDruidJdbcStatement
java.lang.Object
org.apache.druid.sql.avatica.AbstractDruidJdbcStatement
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
DruidJdbcPreparedStatement,DruidJdbcStatement
Common implementation for the JDBC
Statement and
PreparedStatement implementations in Druid. Statement use
DruidJdbcResultSet objects to iterate through rows: zero
or one may be open at any time, and a single statement supports
multiple result sets concurrently. Druid closes the result set after
the last batch in compliance with this note on page 137 of the
JDBC 4.1 specification:
Some JDBC driver implementations may also implicitly close the ResultSet when the ResultSet type is TYPE_FORWARD_ONLY and the next method of ResultSet returns false.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final DruidJdbcResultSet.ResultFetcherFactoryprotected DruidJdbcResultSetprotected SqlQueryPlusstatic final longprotected final intprotected Throwable -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDruidJdbcStatement(String connectionId, int statementId, DruidJdbcResultSet.ResultFetcherFactory fetcherFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidstatic List<org.apache.calcite.avatica.ColumnMetaData>createColumnMetaData(org.apache.calcite.rel.type.RelDataType rowType) protected static org.apache.calcite.avatica.Meta.SignaturecreateSignature(PrepareResult prepareResult, String sql) longabstract org.apache.calcite.avatica.Meta.SignatureintbooleanisDone()org.apache.calcite.avatica.Meta.FramenextFrame(long fetchOffset, int fetchMaxRowCount) protected DruidJdbcResultSet
-
Field Details
-
START_OFFSET
public static final long START_OFFSET- See Also:
-
connectionId
-
statementId
protected final int statementId -
fetcherFactory
-
throwable
-
resultSet
-
sqlQuery
-
-
Constructor Details
-
AbstractDruidJdbcStatement
public AbstractDruidJdbcStatement(String connectionId, int statementId, DruidJdbcResultSet.ResultFetcherFactory fetcherFactory)
-
-
Method Details
-
createSignature
protected static org.apache.calcite.avatica.Meta.Signature createSignature(PrepareResult prepareResult, String sql) -
createColumnMetaData
public static List<org.apache.calcite.avatica.ColumnMetaData> createColumnMetaData(org.apache.calcite.rel.type.RelDataType rowType) -
nextFrame
public org.apache.calcite.avatica.Meta.Frame nextFrame(long fetchOffset, int fetchMaxRowCount) -
getSignature
public abstract org.apache.calcite.avatica.Meta.Signature getSignature() -
closeResultSet
public void closeResultSet() -
requireResultSet
-
getCurrentOffset
public long getCurrentOffset() -
isDone
public boolean isDone() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getConnectionId
-
getStatementId
public int getStatementId() -
getSqlQuery
-