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 extends Object>, 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, transparentReconnectEnabled
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
Constructor Summary
ConstructorDescriptionDrillConnectionImpl
(DriverImpl driver, org.apache.calcite.avatica.AvaticaFactory factory, String url, Properties info) -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
Throws AlreadyClosedSqlException iff this Connection is closed.void
close()
void
commit()
Drill: Not supported.protected ResultSet
createResultSet
(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 Drillbit
int
Drill: Returns zero.boolean
isClosed()
boolean
isValid
(int timeout) protected org.apache.calcite.avatica.Meta.ExecuteResult
prepareAndExecuteInternal
(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) void
releaseSavepoint
(Savepoint savepoint) Drill: Not supported.void
rollback()
Drill: Not supported.void
Drill: Not supported.void
setAutoCommit
(boolean autoCommit) void
setClientInfo
(String name, String value) void
setClientInfo
(Properties properties) void
setNetworkTimeout
(Executor executor, int milliseconds) Drill: Not supported (for non-zero timeout value).Drill: Not supported.setSavepoint
(String name) Drill: Not supported.void
void
setTransactionIsolation
(int level) void
setTypeMap
(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, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.Connection
clearWarnings, createArrayOf, createStatement, createStatement, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getWarnings, isReadOnly, prepareStatement, prepareStatement, prepareStatement, setCatalog, setHoldability, setReadOnly
Methods 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:
createResultSet
in 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:
prepareAndExecuteInternal
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
org.apache.calcite.avatica.NoSuchStatementException
-
checkOpen
Throws AlreadyClosedSqlException iff this Connection is closed.- Overrides:
checkOpen
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
AlreadyClosedSqlException
- if Connection is closed
-
getConfig
Description copied from interface:DrillConnection
Returns a view onto this connection's configuration properties. Code within Optiq should use this view rather than callingProperties.getProperty(String)
.- Specified by:
getConfig
in interfaceDrillConnection
-
getClient
- Specified by:
getClient
in interfaceDrillConnection
-
setAutoCommit
Description copied from interface:DrillConnection
Drill: Accepts only
true
.- Specified by:
setAutoCommit
in interfaceConnection
- Specified by:
setAutoCommit
in interfaceDrillConnection
- Overrides:
setAutoCommit
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
commit
Description copied from interface:DrillConnection
Drill: Not supported. Always throwsSQLFeatureNotSupportedException
(orAlreadyClosedSqlException
).- Specified by:
commit
in interfaceConnection
- Specified by:
commit
in interfaceDrillConnection
- Overrides:
commit
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
rollback
Description copied from interface:DrillConnection
Drill: Not supported. Always throwsSQLFeatureNotSupportedException
(orAlreadyClosedSqlException
).- Specified by:
rollback
in interfaceConnection
- Specified by:
rollback
in interfaceDrillConnection
- Overrides:
rollback
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
isClosed
public boolean isClosed()Description copied from interface:DrillConnection
Drill: Does not throw SQLException.
- Specified by:
isClosed
in interfaceConnection
- Specified by:
isClosed
in interfaceDrillConnection
- Overrides:
isClosed
in classorg.apache.calcite.avatica.AvaticaConnection
-
setSavepoint
Description copied from interface:DrillConnection
Drill: Not supported. Always throwsSQLFeatureNotSupportedException
(orAlreadyClosedSqlException
).- Specified by:
setSavepoint
in interfaceConnection
- Specified by:
setSavepoint
in interfaceDrillConnection
- Overrides:
setSavepoint
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
setSavepoint
Description copied from interface:DrillConnection
Drill: Not supported. Always throwsSQLFeatureNotSupportedException
(orAlreadyClosedSqlException
).- Specified by:
setSavepoint
in interfaceConnection
- Specified by:
setSavepoint
in interfaceDrillConnection
- Overrides:
setSavepoint
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
rollback
Description copied from interface:DrillConnection
Drill: Not supported. Always throwsSQLFeatureNotSupportedException
(orAlreadyClosedSqlException
).- Specified by:
rollback
in interfaceConnection
- Specified by:
rollback
in interfaceDrillConnection
- Overrides:
rollback
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
releaseSavepoint
Description copied from interface:DrillConnection
Drill: Not supported. Always throwsSQLFeatureNotSupportedException
(orAlreadyClosedSqlException
).- Specified by:
releaseSavepoint
in interfaceConnection
- Specified by:
releaseSavepoint
in interfaceDrillConnection
- Overrides:
releaseSavepoint
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
setTransactionIsolation
Description copied from interface:DrillConnection
Drill: Accepts only
Connection.TRANSACTION_NONE
.- Specified by:
setTransactionIsolation
in interfaceConnection
- Specified by:
setTransactionIsolation
in interfaceDrillConnection
- Overrides:
setTransactionIsolation
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
setNetworkTimeout
public void setNetworkTimeout(Executor executor, int milliseconds) throws JdbcApiSqlException, SQLFeatureNotSupportedException Description copied from interface:DrillConnection
Drill: Not supported (for non-zero timeout value).Normally, just throws
SQLFeatureNotSupportedException
unless request is trivially for no timeout (zeromilliseconds
value).- Specified by:
setNetworkTimeout
in interfaceConnection
- Specified by:
setNetworkTimeout
in interfaceDrillConnection
- Overrides:
setNetworkTimeout
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
AlreadyClosedSqlException
- if connection is closedJdbcApiSqlException
- 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:DrillConnection
Drill: Returns zero.- Specified by:
getNetworkTimeout
in interfaceConnection
- Specified by:
getNetworkTimeout
in interfaceDrillConnection
- Overrides:
getNetworkTimeout
in 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:
createStatement
in interfaceConnection
- Overrides:
createStatement
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
getTimeZone
- Overrides:
getTimeZone
in classorg.apache.calcite.avatica.AvaticaConnection
-
prepareCall
- Specified by:
prepareCall
in interfaceConnection
- Overrides:
prepareCall
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
nativeSQL
- Specified by:
nativeSQL
in interfaceConnection
- Overrides:
nativeSQL
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCall
in interfaceConnection
- Overrides:
prepareCall
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
getTypeMap
- Specified by:
getTypeMap
in interfaceConnection
- Overrides:
getTypeMap
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMap
in interfaceConnection
- Overrides:
setTypeMap
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareCall
in interfaceConnection
- Overrides:
prepareCall
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Overrides:
prepareStatement
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
createClob
- Specified by:
createClob
in interfaceConnection
- Overrides:
createClob
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
createBlob
- Specified by:
createBlob
in interfaceConnection
- Overrides:
createBlob
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
createNClob
- Specified by:
createNClob
in interfaceConnection
- Overrides:
createNClob
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXML
in interfaceConnection
- Overrides:
createSQLXML
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
isValid
- Specified by:
isValid
in interfaceConnection
- Overrides:
isValid
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfo
in interfaceConnection
- Overrides:
setClientInfo
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfo
in interfaceConnection
- Overrides:
setClientInfo
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLClientInfoException
-
createStruct
- Specified by:
createStruct
in interfaceConnection
- Overrides:
createStruct
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
setSchema
- Specified by:
setSchema
in interfaceConnection
- Specified by:
setSchema
in interfaceDrillConnection
- Overrides:
setSchema
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
getSchema
- Specified by:
getSchema
in interfaceConnection
- Specified by:
getSchema
in interfaceDrillConnection
- Overrides:
getSchema
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
abort
- Specified by:
abort
in interfaceConnection
- Overrides:
abort
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnection
- Overrides:
close
in classorg.apache.calcite.avatica.AvaticaConnection
- Throws:
SQLException
-
getDrillbit
-