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, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisWrapperFor, unwrappublic 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()
SQLExceptionprotected long nextRequestID()
public void cancelRequest(String id) throws TeiidProcessingException, TeiidComponentException
public void clearWarnings()
throws SQLException
clearWarnings in interface ConnectionSQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface ConnectionSQLExceptionpublic 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 ConnectionSQLException - if the transaction had been rolled back or marked to roll back.public StatementImpl createStatement() throws SQLException
createStatement in interface ConnectionSQLExceptionpublic 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 Connectionintvalue - indicating the ResultSet's typeintValue - indicating the ResultSet's concurrencySQLExceptionpublic boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectionSQLExceptionpublic String getCatalog() throws SQLException
getCatalog in interface ConnectionSQLExceptionpublic ServerConnection getServerConnection() throws SQLException
This method gets the ServerConnection object wrapped by this object.
SQLException@Deprecated public int getVDBVersion() throws SQLException
SQLExceptionpublic DatabaseMetaDataImpl getMetaData() throws SQLException
getMetaData in interface ConnectionSQLExceptionpublic String getDatabaseName()
public int getHoldability()
throws SQLException
getHoldability in interface Connectionholdability - int indicating the holdabilitySQLExceptionpublic int getTransactionIsolation()
throws SQLException
getTransactionIsolation in interface ConnectionSQLExceptionpublic Map<String,Class<?>> getTypeMap() throws SQLException
getTypeMap in interface ConnectionSQLExceptionpublic 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 ConnectionSQLException, - should never occurSQLExceptionpublic boolean isClosed()
throws SQLException
This method will return whether this connection is closed or not.
isClosed in interface ConnectionSQLException, - should never occurSQLExceptionpublic boolean isReadOnly()
throws SQLException
isReadOnly in interface ConnectionSQLExceptionpublic String nativeSQL(String sql) throws SQLException
nativeSQL in interface ConnectionSQLExceptionpublic 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 Connectionsql - 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 Connectionsql - String(escape syntax) for invoking a stored procedure.intvalue - indicating the ResultSet's typeintValue - indicating the ResultSet's concurrencySQLExceptionpublic PreparedStatementImpl prepareStatement(String sql) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatementImpl prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatementImpl prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys) throws SQLException
SQLExceptionpublic PreparedStatementImpl prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic void rollback()
throws SQLException
rollback in interface ConnectionSQLExceptionpublic void rollback(boolean startTxn)
throws SQLException
startTxn - SQLExceptionpublic ResultsFuture<?> submitSetAutoCommitTrue(boolean commit) throws SQLException
SQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws SQLException
setAutoCommit in interface ConnectionSQLExceptionpublic 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 ConnectionThe - 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 ConnectionA - boolean value specifying whether the connection is readonly.throws - SQLException.SQLExceptionprotected void commitTransaction(XidImpl arg0, boolean arg1) throws SQLException
SQLExceptionprotected void endTransaction(XidImpl arg0, int arg1) throws SQLException
SQLExceptionprotected void forgetTransaction(XidImpl arg0) throws SQLException
SQLExceptionprotected int prepareTransaction(XidImpl arg0) throws SQLException
SQLExceptionprotected Xid[] recoverTransaction(int arg0) throws SQLException
SQLExceptionprotected void rollbackTransaction(XidImpl arg0) throws SQLException
SQLExceptionprotected void startTransaction(XidImpl arg0, int arg1, int timeout) throws SQLException
SQLExceptionprotected XidImpl getTransactionXid()
public boolean isValid(int timeout)
throws SQLException
isValid in interface ConnectionSQLExceptionpublic void recycleConnection()
public boolean isSameProcess(ConnectionImpl conn) throws CommunicationException
CommunicationExceptionpublic void setClientInfo(Properties properties) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic void setClientInfo(String name, String value) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic Properties getClientInfo() throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic String getClientInfo(String name) throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic Array createArrayOf(String typeName, Object[] elements) throws SQLException
createArrayOf in interface ConnectionSQLExceptionpublic Blob createBlob() throws SQLException
createBlob in interface ConnectionSQLExceptionpublic Clob createClob() throws SQLException
createClob in interface ConnectionSQLExceptionpublic NClob createNClob() throws SQLException
createNClob in interface ConnectionSQLExceptionpublic SQLXML createSQLXML() throws SQLException
createSQLXML in interface ConnectionSQLExceptionpublic StatementImpl createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic Struct createStruct(String typeName, Object[] attributes) throws SQLException
createStruct in interface ConnectionSQLExceptionpublic CallableStatementImpl prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic void releaseSavepoint(Savepoint savepoint) throws SQLException
releaseSavepoint in interface ConnectionSQLExceptionpublic void rollback(Savepoint savepoint) throws SQLException
rollback in interface ConnectionSQLExceptionpublic void setHoldability(int holdability)
throws SQLException
setHoldability in interface ConnectionSQLExceptionpublic Savepoint setSavepoint() throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic Savepoint setSavepoint(String name) throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic void setTransactionIsolation(int level)
throws SQLException
setTransactionIsolation in interface ConnectionSQLExceptionpublic void setTypeMap(Map<String,Class<?>> map) throws SQLException
setTypeMap in interface ConnectionSQLExceptionpublic void changeUser(String userName, String newPassword) throws SQLException
TeiidConnectionchangeUser in interface TeiidConnectionuserName - the username to authenticate withnewPassword - the password to authenticate withSQLExceptionpublic void abort(Executor executor) throws SQLException
abort in interface ConnectionSQLExceptionpublic int getNetworkTimeout()
throws SQLException
getNetworkTimeout in interface ConnectionSQLExceptionpublic String getSchema() throws SQLException
getSchema in interface ConnectionSQLExceptionpublic void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
setNetworkTimeout in interface ConnectionSQLExceptiontimeouts and the synchronousTtl setting if using socket connectionspublic void setSchema(String schema) throws SQLException
setSchema in interface ConnectionSQLExceptionpublic 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.