Package org.apache.drill.jdbc.impl
Class DrillConnectionImpl
java.lang.Object
org.apache.calcite.avatica.AvaticaConnection
org.apache.drill.jdbc.impl.DrillConnectionImpl
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper,DrillConnection
public class DrillConnectionImpl
extends org.apache.calcite.avatica.AvaticaConnection
implements DrillConnection
Drill's implementation of
Connection.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.avatica.AvaticaConnection
org.apache.calcite.avatica.AvaticaConnection.CallableWithoutException<T>, org.apache.calcite.avatica.AvaticaConnection.Trojan -
Field Summary
Fields inherited from class org.apache.calcite.avatica.AvaticaConnection
driver, factory, handle, HELPER, id, info, maxRetriesPerExecute, meta, metaData, NUM_EXECUTE_RETRIES_DEFAULT, NUM_EXECUTE_RETRIES_KEY, PLAN_COLUMN_NAME, properties, ROWCOUNT_COLUMN_NAME, statementCount, statementMap, transparentReconnectEnabledFields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
ConstructorsConstructorDescriptionDrillConnectionImpl(DriverImpl driver, org.apache.calcite.avatica.AvaticaFactory factory, String url, Properties info) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidThrows AlreadyClosedSqlException iff this Connection is closed.voidclose()voidcommit()Drill: Not supported.protected ResultSetcreateResultSet(org.apache.calcite.avatica.Meta.MetaResultSet metaResultSet, org.apache.calcite.avatica.QueryState state) createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) createStruct(String typeName, Object[] attributes) Returns a view onto this connection's configuration properties.protected DrillbitintDrill: Returns zero.booleanisClosed()booleanisValid(int timeout) protected org.apache.calcite.avatica.Meta.ExecuteResultprepareAndExecuteInternal(org.apache.calcite.avatica.AvaticaStatement statement, String sql, long maxRowCount) prepareCall(String sql) prepareCall(String sql, int resultSetType, int resultSetConcurrency) prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement(String sql, int autoGeneratedKeys) prepareStatement(String sql, int[] columnIndexes) prepareStatement(String sql, String[] columnNames) voidreleaseSavepoint(Savepoint savepoint) Drill: Not supported.voidrollback()Drill: Not supported.voidDrill: Not supported.voidsetAutoCommit(boolean autoCommit) voidsetClientInfo(String name, String value) voidsetClientInfo(Properties properties) voidsetNetworkTimeout(Executor executor, int milliseconds) Drill: Not supported (for non-zero timeout value).Drill: Not supported.setSavepoint(String name) Drill: Not supported.voidvoidsetTransactionIsolation(int level) voidsetTypeMap(Map<String, Class<?>> map) Methods inherited from class org.apache.calcite.avatica.AvaticaConnection
clearWarnings, config, createArrayOf, createStatement, createStatement, createTrojan, executeBatchUpdateInternal, executeQueryInternal, getAutoCommit, getCancelFlag, getCatalog, getClientInfo, getClientInfo, getHoldability, getKerberosConnection, getMetaData, getService, getTransactionIsolation, getWarnings, invokeWithRetries, isReadOnly, isWrapperFor, lookupStatement, openConnection, prepareAndUpdateBatch, prepareStatement, prepareStatement, prepareStatement, setCatalog, setHoldability, setKerberosConnection, setReadOnly, setService, unwrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, clearWarnings, createArrayOf, createStatement, createStatement, endRequest, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getWarnings, isReadOnly, prepareStatement, prepareStatement, prepareStatement, setCatalog, setHoldability, setReadOnly, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValidMethods inherited from interface org.apache.drill.jdbc.DrillConnection
getAutoCommit, getTransactionIsolation, isWrapperFor, unwrap
-
Constructor Details
-
DrillConnectionImpl
public DrillConnectionImpl(DriverImpl driver, org.apache.calcite.avatica.AvaticaFactory factory, String url, Properties info) throws SQLException - Throws:
SQLException
-
-
Method Details
-
createResultSet
protected ResultSet createResultSet(org.apache.calcite.avatica.Meta.MetaResultSet metaResultSet, org.apache.calcite.avatica.QueryState state) throws SQLException - Overrides:
createResultSetin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
prepareAndExecuteInternal
protected org.apache.calcite.avatica.Meta.ExecuteResult prepareAndExecuteInternal(org.apache.calcite.avatica.AvaticaStatement statement, String sql, long maxRowCount) throws SQLException, org.apache.calcite.avatica.NoSuchStatementException - Overrides:
prepareAndExecuteInternalin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLExceptionorg.apache.calcite.avatica.NoSuchStatementException
-
checkOpen
Throws AlreadyClosedSqlException iff this Connection is closed.- Overrides:
checkOpenin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
AlreadyClosedSqlException- if Connection is closed
-
getConfig
Description copied from interface:DrillConnectionReturns a view onto this connection's configuration properties. Code within Optiq should use this view rather than callingProperties.getProperty(String).- Specified by:
getConfigin interfaceDrillConnection
-
getClient
- Specified by:
getClientin interfaceDrillConnection
-
setAutoCommit
Description copied from interface:DrillConnectionDrill: Accepts only
true.- Specified by:
setAutoCommitin interfaceConnection- Specified by:
setAutoCommitin interfaceDrillConnection- Overrides:
setAutoCommitin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
commit
Description copied from interface:DrillConnectionDrill: Not supported. Always throwsSQLFeatureNotSupportedException(orAlreadyClosedSqlException).- Specified by:
commitin interfaceConnection- Specified by:
commitin interfaceDrillConnection- Overrides:
commitin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
rollback
Description copied from interface:DrillConnectionDrill: Not supported. Always throwsSQLFeatureNotSupportedException(orAlreadyClosedSqlException).- Specified by:
rollbackin interfaceConnection- Specified by:
rollbackin interfaceDrillConnection- Overrides:
rollbackin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
isClosed
public boolean isClosed()Description copied from interface:DrillConnectionDrill: Does not throw SQLException.
- Specified by:
isClosedin interfaceConnection- Specified by:
isClosedin interfaceDrillConnection- Overrides:
isClosedin classorg.apache.calcite.avatica.AvaticaConnection
-
setSavepoint
Description copied from interface:DrillConnectionDrill: Not supported. Always throwsSQLFeatureNotSupportedException(orAlreadyClosedSqlException).- Specified by:
setSavepointin interfaceConnection- Specified by:
setSavepointin interfaceDrillConnection- Overrides:
setSavepointin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
setSavepoint
Description copied from interface:DrillConnectionDrill: Not supported. Always throwsSQLFeatureNotSupportedException(orAlreadyClosedSqlException).- Specified by:
setSavepointin interfaceConnection- Specified by:
setSavepointin interfaceDrillConnection- Overrides:
setSavepointin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
rollback
Description copied from interface:DrillConnectionDrill: Not supported. Always throwsSQLFeatureNotSupportedException(orAlreadyClosedSqlException).- Specified by:
rollbackin interfaceConnection- Specified by:
rollbackin interfaceDrillConnection- Overrides:
rollbackin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
releaseSavepoint
Description copied from interface:DrillConnectionDrill: Not supported. Always throwsSQLFeatureNotSupportedException(orAlreadyClosedSqlException).- Specified by:
releaseSavepointin interfaceConnection- Specified by:
releaseSavepointin interfaceDrillConnection- Overrides:
releaseSavepointin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
setTransactionIsolation
Description copied from interface:DrillConnectionDrill: Accepts only
Connection.TRANSACTION_NONE.- Specified by:
setTransactionIsolationin interfaceConnection- Specified by:
setTransactionIsolationin interfaceDrillConnection- Overrides:
setTransactionIsolationin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
setNetworkTimeout
public void setNetworkTimeout(Executor executor, int milliseconds) throws JdbcApiSqlException, SQLFeatureNotSupportedException Description copied from interface:DrillConnectionDrill: Not supported (for non-zero timeout value).Normally, just throws
SQLFeatureNotSupportedExceptionunless request is trivially for no timeout (zeromillisecondsvalue).- Specified by:
setNetworkTimeoutin interfaceConnection- Specified by:
setNetworkTimeoutin interfaceDrillConnection- Overrides:
setNetworkTimeoutin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
JdbcApiSqlException- if an invalid parameter value is detected (and not above case)SQLFeatureNotSupportedException- if timeout is non-zero (and not above case)
-
getNetworkTimeout
Description copied from interface:DrillConnectionDrill: Returns zero.- Specified by:
getNetworkTimeoutin interfaceConnection- Specified by:
getNetworkTimeoutin interfaceDrillConnection- Overrides:
getNetworkTimeoutin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
AlreadyClosedSqlException- if connection is closed
-
createStatement
public DrillStatementImpl createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
createStatementin interfaceConnection- Overrides:
createStatementin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
getTimeZone
- Overrides:
getTimeZonein classorg.apache.calcite.avatica.AvaticaConnection
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Overrides:
prepareCallin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
nativeSQL
- Specified by:
nativeSQLin interfaceConnection- Overrides:
nativeSQLin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCallin interfaceConnection- Overrides:
prepareCallin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
getTypeMap
- Specified by:
getTypeMapin interfaceConnection- Overrides:
getTypeMapin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMapin interfaceConnection- Overrides:
setTypeMapin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareCallin interfaceConnection- Overrides:
prepareCallin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Overrides:
prepareStatementin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Overrides:
prepareStatementin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Overrides:
prepareStatementin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
createClob
- Specified by:
createClobin interfaceConnection- Overrides:
createClobin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
createBlob
- Specified by:
createBlobin interfaceConnection- Overrides:
createBlobin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
createNClob
- Specified by:
createNClobin interfaceConnection- Overrides:
createNClobin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXMLin interfaceConnection- Overrides:
createSQLXMLin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
isValid
- Specified by:
isValidin interfaceConnection- Overrides:
isValidin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Overrides:
setClientInfoin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Overrides:
setClientInfoin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLClientInfoException
-
createStruct
- Specified by:
createStructin interfaceConnection- Overrides:
createStructin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
setSchema
- Specified by:
setSchemain interfaceConnection- Specified by:
setSchemain interfaceDrillConnection- Overrides:
setSchemain classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
getSchema
- Specified by:
getSchemain interfaceConnection- Specified by:
getSchemain interfaceDrillConnection- Overrides:
getSchemain classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
abort
- Specified by:
abortin interfaceConnection- Overrides:
abortin classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Overrides:
closein classorg.apache.calcite.avatica.AvaticaConnection- Throws:
SQLException
-
getDrillbit
-