public class ConnectionImpl extends WrapperImpl implements TeiidConnection
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ISOLATION |
protected Properties |
propInfo |
protected ServerConnection |
serverConn |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
Constructor and Description |
---|
ConnectionImpl(ServerConnection serverConn,
Properties info,
String url) |
Modifier and Type | Method and Description |
---|---|
void |
abort(Executor executor) |
void |
cancelRequest(String id)
Cancel the request
|
void |
changeUser(String userName,
String newPassword)
Re-authenticate with the given username and password.
|
void |
clearWarnings() |
void |
close() |
void |
commit()
This method makes any changes involved in a transaction permanent and releases
any locks held by the connection object.
|
protected void |
commitTransaction(XidImpl arg0,
boolean arg1) |
Array |
createArrayOf(String typeName,
Object[] elements) |
Blob |
createBlob() |
Clob |
createClob() |
NClob |
createNClob() |
SQLXML |
createSQLXML() |
StatementImpl |
createStatement() |
StatementImpl |
createStatement(int resultSetType,
int resultSetConcurrency)
Creates a Statement object that will produce ResultSet objects of the type
resultSetType and concurrency level resultSetConcurrency.
|
StatementImpl |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Struct |
createStruct(String typeName,
Object[] attributes) |
protected void |
endTransaction(XidImpl arg0,
int arg1) |
protected void |
forgetTransaction(XidImpl arg0) |
Collection<Annotation> |
getAnnotations() |
boolean |
getAutoCommit() |
String |
getCatalog() |
Properties |
getClientInfo() |
String |
getClientInfo(String name) |
String |
getConnectionId()
Connection identifier of this connection
|
Properties |
getConnectionProps() |
PlanNode |
getCurrentPlanDescription() |
String |
getDatabaseName()
Get the database name that this connection is representing
|
String |
getDebugLog() |
protected Properties |
getExecutionProperties() |
String |
getExecutionProperty(String key) |
int |
getHoldability()
Retrieves the current holdability of ResultSet objects created using this Connection object.
|
DatabaseMetaDataImpl |
getMetaData() |
int |
getNetworkTimeout() |
Properties |
getPayload() |
String |
getSchema() |
ServerConnection |
getServerConnection()
This method gets the ServerConnection object wrapped by this object.
|
int |
getTransactionIsolation() |
protected XidImpl |
getTransactionXid() |
Map<String,Class<?>> |
getTypeMap() |
int |
getVDBVersion()
Deprecated.
|
SQLWarning |
getWarnings()
This method will return the first warning reported by calls on this connection,
or null if none exist.
|
boolean |
isClosed()
This method will return whether this connection is closed or not.
|
boolean |
isReadOnly() |
boolean |
isSameProcess(ConnectionImpl conn) |
boolean |
isValid(int timeout) |
String |
nativeSQL(String sql) |
protected long |
nextRequestID()
Generate the next unique requestID for matching up requests with responses.
|
CallableStatementImpl |
prepareCall(String sql)
Creates a CallableStatement object that contains sql and that will produce
ResultSet objects that are non-scrollable and non-updatable.
|
CallableStatementImpl |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
Creates a CallableStatement object that contains a sql and that will produce
ResultSet objects of the type resultSetType and with a concurrency level of
resultSetConcurrency.
|
CallableStatementImpl |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
PreparedStatementImpl |
prepareStatement(String sql) |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys) |
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes) |
PreparedStatementImpl |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) |
PreparedStatementImpl |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
PreparedStatementImpl |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability,
int autoGeneratedKeys) |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames) |
protected int |
prepareTransaction(XidImpl arg0) |
protected Xid[] |
recoverTransaction(int arg0) |
void |
recycleConnection() |
void |
releaseSavepoint(Savepoint savepoint) |
void |
restoreTransactionCharacteristics() |
void |
rollback() |
void |
rollback(boolean startTxn)
Rollback the current local transaction
|
void |
rollback(Savepoint savepoint) |
protected void |
rollbackTransaction(XidImpl arg0) |
void |
saveTransactionCharacteristics() |
void |
setAnnotations(Collection<Annotation> annotations) |
void |
setAutoCommit(boolean autoCommit) |
void |
setCatalog(String catalog)
Teiid does not allow setting a catalog through a connection.
|
void |
setClientInfo(Properties properties) |
void |
setClientInfo(String name,
String value) |
void |
setCurrentPlanDescription(PlanNode currentPlanDescription) |
void |
setDebugLog(String debugLog) |
void |
setExecutionProperty(String key,
String value) |
void |
setHoldability(int holdability) |
void |
setInLocalTxn(boolean inLocalTxn) |
void |
setNetworkTimeout(Executor executor,
int milliseconds) |
void |
setPayload(Properties payload) |
void |
setReadOnly(boolean readOnly) |
Savepoint |
setSavepoint() |
Savepoint |
setSavepoint(String name) |
void |
setSchema(String schema) |
void |
setTransactionIsolation(int level) |
void |
setTypeMap(Map<String,Class<?>> map) |
protected void |
startTransaction(XidImpl arg0,
int arg1,
int timeout) |
ResultsFuture<?> |
submitSetAutoCommitTrue(boolean commit) |
isWrapperFor, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isWrapperFor, unwrap
public static final int DEFAULT_ISOLATION
protected Properties propInfo
protected ServerConnection serverConn
public ConnectionImpl(ServerConnection serverConn, Properties info, String url)
public Collection<Annotation> getAnnotations()
public void setAnnotations(Collection<Annotation> annotations)
public String getDebugLog()
public void setDebugLog(String debugLog)
public PlanNode getCurrentPlanDescription()
public void setCurrentPlanDescription(PlanNode currentPlanDescription)
protected Properties getExecutionProperties()
public String getConnectionId()
SQLException
protected long nextRequestID()
public void cancelRequest(String id) throws TeiidProcessingException, TeiidComponentException
public void clearWarnings() throws SQLException
clearWarnings
in interface Connection
SQLException
public void close() throws SQLException
close
in interface AutoCloseable
close
in interface Connection
SQLException
public void commit() throws SQLException
This method makes any changes involved in a transaction permanent and releases any locks held by the connection object. This is only used when auto-commit is set to false.
commit
in interface Connection
SQLException
- if the transaction had been rolled back or marked to roll back.public StatementImpl createStatement() throws SQLException
createStatement
in interface Connection
SQLException
public StatementImpl createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
Creates a Statement object that will produce ResultSet objects of the type resultSetType and concurrency level resultSetConcurrency.
createStatement
in interface Connection
intvalue
- indicating the ResultSet's typeintValue
- indicating the ResultSet's concurrencySQLException
public boolean getAutoCommit() throws SQLException
getAutoCommit
in interface Connection
SQLException
public String getCatalog() throws SQLException
getCatalog
in interface Connection
SQLException
public ServerConnection getServerConnection() throws SQLException
This method gets the ServerConnection object wrapped by this object.
SQLException
@Deprecated public int getVDBVersion() throws SQLException
SQLException
public DatabaseMetaDataImpl getMetaData() throws SQLException
getMetaData
in interface Connection
SQLException
public String getDatabaseName()
public int getHoldability() throws SQLException
getHoldability
in interface Connection
holdability
- int indicating the holdabilitySQLException
public int getTransactionIsolation() throws SQLException
getTransactionIsolation
in interface Connection
SQLException
public Map<String,Class<?>> getTypeMap() throws SQLException
getTypeMap
in interface Connection
SQLException
public SQLWarning getWarnings() throws SQLException
This method will return the first warning reported by calls on this connection, or null if none exist.
getWarnings
in interface Connection
SQLException,
- should never occurSQLException
public boolean isClosed() throws SQLException
This method will return whether this connection is closed or not.
isClosed
in interface Connection
SQLException,
- should never occurSQLException
public boolean isReadOnly() throws SQLException
isReadOnly
in interface Connection
SQLException
public String nativeSQL(String sql) throws SQLException
nativeSQL
in interface Connection
SQLException
public CallableStatementImpl prepareCall(String sql) throws SQLException
Creates a CallableStatement object that contains sql and that will produce ResultSet objects that are non-scrollable and non-updatable. A SQL stored procedure call statement is handled by creating a CallableStatement for it.
prepareCall
in interface Connection
sql
- String(escape syntax) for invoking a stored procedure.SQLException
- if there is an error creating the callable statement objectpublic CallableStatementImpl prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
Creates a CallableStatement object that contains a sql and that will produce ResultSet objects of the type resultSetType and with a concurrency level of resultSetConcurrency. A SQL stored procedure call statement is handled by creating a CallableStatement for it.
prepareCall
in interface Connection
sql
- String(escape syntax) for invoking a stored procedure.intvalue
- indicating the ResultSet's typeintValue
- indicating the ResultSet's concurrencySQLException
public PreparedStatementImpl prepareStatement(String sql) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatementImpl prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatementImpl prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys) throws SQLException
SQLException
public PreparedStatementImpl prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement
in interface Connection
SQLException
public void rollback() throws SQLException
rollback
in interface Connection
SQLException
public void rollback(boolean startTxn) throws SQLException
startTxn
- SQLException
public ResultsFuture<?> submitSetAutoCommitTrue(boolean commit) throws SQLException
SQLException
public void setAutoCommit(boolean autoCommit) throws SQLException
setAutoCommit
in interface Connection
SQLException
public void setCatalog(String catalog) throws SQLException
Teiid does not allow setting a catalog through a connection. This method silently ignores the request as per the specification.
setCatalog
in interface Connection
The
- string values which sets the catalog name on the connection.SQLException
- This should never occur.public void setReadOnly(boolean readOnly) throws SQLException
setReadOnly
in interface Connection
A
- boolean value specifying whether the connection is readonly.throws
- SQLException.SQLException
protected void commitTransaction(XidImpl arg0, boolean arg1) throws SQLException
SQLException
protected void endTransaction(XidImpl arg0, int arg1) throws SQLException
SQLException
protected void forgetTransaction(XidImpl arg0) throws SQLException
SQLException
protected int prepareTransaction(XidImpl arg0) throws SQLException
SQLException
protected Xid[] recoverTransaction(int arg0) throws SQLException
SQLException
protected void rollbackTransaction(XidImpl arg0) throws SQLException
SQLException
protected void startTransaction(XidImpl arg0, int arg1, int timeout) throws SQLException
SQLException
protected XidImpl getTransactionXid()
public boolean isValid(int timeout) throws SQLException
isValid
in interface Connection
SQLException
public void recycleConnection()
public boolean isSameProcess(ConnectionImpl conn) throws CommunicationException
CommunicationException
public void setClientInfo(Properties properties) throws SQLClientInfoException
setClientInfo
in interface Connection
SQLClientInfoException
public void setClientInfo(String name, String value) throws SQLClientInfoException
setClientInfo
in interface Connection
SQLClientInfoException
public Properties getClientInfo() throws SQLException
getClientInfo
in interface Connection
SQLException
public String getClientInfo(String name) throws SQLException
getClientInfo
in interface Connection
SQLException
public Array createArrayOf(String typeName, Object[] elements) throws SQLException
createArrayOf
in interface Connection
SQLException
public Blob createBlob() throws SQLException
createBlob
in interface Connection
SQLException
public Clob createClob() throws SQLException
createClob
in interface Connection
SQLException
public NClob createNClob() throws SQLException
createNClob
in interface Connection
SQLException
public SQLXML createSQLXML() throws SQLException
createSQLXML
in interface Connection
SQLException
public StatementImpl createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement
in interface Connection
SQLException
public Struct createStruct(String typeName, Object[] attributes) throws SQLException
createStruct
in interface Connection
SQLException
public CallableStatementImpl prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement
in interface Connection
SQLException
public void releaseSavepoint(Savepoint savepoint) throws SQLException
releaseSavepoint
in interface Connection
SQLException
public void rollback(Savepoint savepoint) throws SQLException
rollback
in interface Connection
SQLException
public void setHoldability(int holdability) throws SQLException
setHoldability
in interface Connection
SQLException
public Savepoint setSavepoint() throws SQLException
setSavepoint
in interface Connection
SQLException
public Savepoint setSavepoint(String name) throws SQLException
setSavepoint
in interface Connection
SQLException
public void setTransactionIsolation(int level) throws SQLException
setTransactionIsolation
in interface Connection
SQLException
public void setTypeMap(Map<String,Class<?>> map) throws SQLException
setTypeMap
in interface Connection
SQLException
public void changeUser(String userName, String newPassword) throws SQLException
TeiidConnection
changeUser
in interface TeiidConnection
userName
- the username to authenticate withnewPassword
- the password to authenticate withSQLException
public void abort(Executor executor) throws SQLException
abort
in interface Connection
SQLException
public int getNetworkTimeout() throws SQLException
getNetworkTimeout
in interface Connection
SQLException
public String getSchema() throws SQLException
getSchema
in interface Connection
SQLException
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
setNetworkTimeout
in interface Connection
SQLException
timeouts and the synchronousTtl setting if using socket connections
public void setSchema(String schema) throws SQLException
setSchema
in interface Connection
SQLException
public Properties getPayload()
public void setPayload(Properties payload)
public Properties getConnectionProps()
public void setInLocalTxn(boolean inLocalTxn)
public void saveTransactionCharacteristics()
public void restoreTransactionCharacteristics()
Copyright © 2019. All rights reserved.