Package org.apache.druid.sql.avatica
Class DruidConnection
java.lang.Object
org.apache.druid.sql.avatica.DruidConnection
Connection tracking for
DruidMeta. Thread-safe.
Lock is the instance itself. Used here to protect two members, and in other code when we must resolve the connection after resolving the statement. The lock prevents closing the connection concurrently with an operation on a statement for that connection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanCloses this connection if it has no statements.voidcloseStatement(int statementId) createPreparedStatement(SqlStatementFactory sqlStatementFactory, SqlQueryPlus sqlQueryPlus, Map<String, Object> systemDefaultContext, long maxRowCount, DruidJdbcResultSet.ResultFetcherFactory fetcherFactory) createStatement(SqlStatementFactory sqlStatementFactory, Map<String, Object> systemDefaultContext, DruidJdbcResultSet.ResultFetcherFactory fetcherFactory) getStatement(int statementId)
-
Constructor Details
-
DruidConnection
-
-
Method Details
-
getConnectionId
-
sessionContext
-
userSecret
-
createStatement
public DruidJdbcStatement createStatement(SqlStatementFactory sqlStatementFactory, Map<String, Object> systemDefaultContext, DruidJdbcResultSet.ResultFetcherFactory fetcherFactory) -
createPreparedStatement
public DruidJdbcPreparedStatement createPreparedStatement(SqlStatementFactory sqlStatementFactory, SqlQueryPlus sqlQueryPlus, Map<String, Object> systemDefaultContext, long maxRowCount, DruidJdbcResultSet.ResultFetcherFactory fetcherFactory) -
getStatement
-
closeStatement
public void closeStatement(int statementId) -
closeIfEmpty
public boolean closeIfEmpty()Closes this connection if it has no statements.- Returns:
- true if closed
-
close
public void close() -
sync
-