|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.teiid.jdbc.WrapperImpl
org.teiid.jdbc.ConnectionImpl
public class ConnectionImpl
| Field Summary | |
|---|---|
static int |
DEFAULT_ISOLATION
|
protected java.util.Properties |
propInfo
|
protected ServerConnection |
serverConn
|
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
|---|---|
ConnectionImpl(ServerConnection serverConn,
java.util.Properties info,
java.lang.String url)
|
|
| Method Summary | |
|---|---|
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)
|
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
|
java.sql.Blob |
createBlob()
|
java.sql.Clob |
createClob()
|
java.sql.NClob |
createNClob()
|
java.sql.SQLXML |
createSQLXML()
|
java.sql.Statement |
createStatement()
This creates a MMStatement object for sending SQL statements to the MetaMatrix server. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Creates a Statement object that will produce ResultSet objects of the type resultSetType and concurrency level resultSetConcurrency. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
|
protected void |
endTransaction(XidImpl arg0,
int arg1)
|
protected void |
forgetTransaction(XidImpl arg0)
|
boolean |
getAutoCommit()
This method returns the current status of the connection in regards to it's auto-commit state. |
java.lang.String |
getCatalog()
|
java.util.Properties |
getClientInfo()
|
java.lang.String |
getClientInfo(java.lang.String name)
|
java.lang.String |
getConnectionId()
Connection identifier of this connection |
protected java.util.Properties |
getConnectionProperties()
|
java.lang.String |
getDatabaseName()
Get the database name that this connection is representing |
int |
getHoldability()
Retrieves the current holdability of ResultSet objects created using this Connection object. |
java.sql.DatabaseMetaData |
getMetaData()
|
int |
getTransactionIsolation()
|
protected XidImpl |
getTransactionXid()
|
java.util.Map |
getTypeMap()
Retreives the type map associated with this Connection object. |
int |
getVDBVersion()
|
java.sql.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()
This method will return whether this connection is read only or not. |
boolean |
isSameProcess(ConnectionImpl conn)
|
boolean |
isValid(int timeout)
|
java.lang.String |
nativeSQL(java.lang.String sql)
This method will convert the given SQL String into a MetaMatrix SQL Request. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Creates a CallableStatement object that contains sql and that will produce ResultSet objects that are non-scrollable and non-updatable. |
java.sql.CallableStatement |
prepareCall(java.lang.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. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
This method creates a MMPreparedStatement which is used for sending parameterized SQL statements to the MetaMatrix server. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Creates a PreparedStatement object that contains a sql and that will produce ResultSet objects of the type resultSetType and with a concurrency level of resultSetConcurrency. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
This method creates a MMPreparedStatement which is used for sending parameterized SQL statements to the MetaMatrix server and it has the capability to retrieve auto-generated keys. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
|
protected int |
prepareTransaction(XidImpl arg0)
|
protected javax.transaction.xa.Xid[] |
recoverTransaction(int arg0)
|
void |
recycleConnection()
|
void |
releaseSavepoint(java.sql.Savepoint savepoint)
|
void |
rollback()
This method will drop all changes made since the beginning of the transaction and release any MetaMatrix server locks currently held by this connection. |
void |
rollback(java.sql.Savepoint savepoint)
|
protected void |
rollbackTransaction(XidImpl arg0)
|
void |
setAutoCommit(boolean autoCommit)
This method will set the connection's auto commit mode accordingly. |
void |
setCatalog(java.lang.String catalog)
Metamatrix does not allow setting a catalog through a connection. |
void |
setClientInfo(java.util.Properties properties)
|
void |
setClientInfo(java.lang.String name,
java.lang.String value)
|
void |
setHoldability(int holdability)
|
void |
setReadOnly(boolean readOnly)
|
java.sql.Savepoint |
setSavepoint()
|
java.sql.Savepoint |
setSavepoint(java.lang.String name)
|
void |
setTransactionIsolation(int level)
|
void |
setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
|
protected void |
startTransaction(XidImpl arg0,
int arg1,
int timeout)
|
| Methods inherited from class org.teiid.jdbc.WrapperImpl |
|---|
isWrapperFor, 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.Wrapper |
|---|
isWrapperFor, unwrap |
| Field Detail |
|---|
public static final int DEFAULT_ISOLATION
protected java.util.Properties propInfo
protected ServerConnection serverConn
| Constructor Detail |
|---|
public ConnectionImpl(ServerConnection serverConn,
java.util.Properties info,
java.lang.String url)
| Method Detail |
|---|
protected java.util.Properties getConnectionProperties()
public java.lang.String getConnectionId()
java.sql.SQLException
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLException
public void close()
throws java.sql.SQLException
close in interface java.sql.Connectionjava.sql.SQLException
public void commit()
throws java.sql.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 java.sql.Connectionjava.sql.SQLException - if the transaction had been rolled back or marked to roll back.
public java.sql.Statement createStatement()
throws java.sql.SQLException
This creates a MMStatement object for sending SQL statements to the MetaMatrix server. This should be used for statements without parameters. For statements that are executed many times, use the PreparedStatement object.
createStatement in interface java.sql.Connectiona - SQLException if a MetaMatrix server access error occurs.
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
Creates a Statement object that will produce ResultSet objects of the type resultSetType and concurrency level resultSetConcurrency.
createStatement in interface java.sql.Connectionintvalue - indicating the ResultSet's typeintValue - indicating the ResultSet's concurrency
java.sql.SQLException
public boolean getAutoCommit()
throws java.sql.SQLException
This method returns the current status of the connection in regards to it's auto-commit state. By default, the auto-commit is set to true. Meaning that any transaction that occurs is automatically commited to the MetaMatrix server. #See corresponding setAutoCommit() method.
getAutoCommit in interface java.sql.Connectionjava.sql.SQLException - should never happen
public java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLException
public int getVDBVersion()
throws java.sql.SQLException
java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getDatabaseName()
public int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.Connectionholdability - int indicating the holdability
java.sql.SQLException
public int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException
public java.util.Map getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.ConnectionSQLException, - should never occur
java.sql.SQLException
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
This method will return the first warning reported by calls on this connection, or null if none exist.
getWarnings in interface java.sql.ConnectionSQLException, - should never occur
java.sql.SQLException
public boolean isClosed()
throws java.sql.SQLException
This method will return whether this connection is closed or not.
isClosed in interface java.sql.ConnectionSQLException, - should never occur
java.sql.SQLException
public boolean isReadOnly()
throws java.sql.SQLException
This method will return whether this connection is read only or not. It will throw a SQLException if a MetaMatrix server access error occurs.
isReadOnly in interface java.sql.ConnectionSQLException, - should never occur
java.sql.SQLException
public java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
This method will convert the given SQL String into a MetaMatrix SQL Request. This will convert any date escape sequences into the appropriate MetaMatrix type, and any kind of data transformations that the MetaMatrix server would expect. This method returns the native form of the statement that the driver would have sent.
nativeSQL in interface java.sql.Connectionsql - string to be coverted into SQL understood by metamatrix
SQLException, - should never occur
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.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 java.sql.Connectionsql - String(escape syntax) for invoking a stored procedure.
java.sql.SQLException - if there is an error creating the callable statement object
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.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 java.sql.Connectionsql - String(escape syntax) for invoking a stored procedure.intvalue - indicating the ResultSet's typeintValue - indicating the ResultSet's concurrency
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
This method creates a MMPreparedStatement which is used for sending parameterized SQL statements to the MetaMatrix server. A statement with or without IN parameters can be pre-compiled and stored in a MMPreparedStatement object. Since the MetaMatrix server does not pre-compile statements, a sql statement will be constructed using the parameters supplied which would be used for execution of this preparedStatement object.
prepareStatement in interface java.sql.Connectionsql - string representing a prepared statement
java.sql.SQLException - if there is an error creating a prepared statement object
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
Creates a PreparedStatement object that contains a sql and that will produce ResultSet objects of the type resultSetType and with a concurrency level of resultSetConcurrency.
prepareStatement in interface java.sql.Connectionsql - string representing a prepared statementintvalue - indicating the ResultSet's typeintValue - indicating the ResultSet's concurrency
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
This method creates a MMPreparedStatement which is used for sending parameterized SQL statements to the MetaMatrix server and it has the capability to retrieve auto-generated keys.
prepareStatement in interface java.sql.Connectionsql - string representing a prepared statementintValue - indicating the result set TypeintValue - indicating the result set concurrencyintValue - indicating the result set holdability
java.sql.SQLException - if there is an error creating a prepared statement object
public void rollback()
throws java.sql.SQLException
This method will drop all changes made since the beginning of the transaction and release any MetaMatrix server locks currently held by this connection. This method rolls back transactions on all the statements currently open on this connection. This is used when then auto-commit has been disabled.
rollback in interface java.sql.Connectionjava.sql.SQLException - if there is an error rolling back.method for more information.
public void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
This method will set the connection's auto commit mode accordingly. By default this is set to true (auto-commit is turned on). An auto-commit value of true means any statements will automatically be made permanent if they are successful after the last row of the ReulstSet has been retrieved or the next execute occurs, whichever comes first. If set to false, changes can be either be committed (using the commit() method) or rolled back ("undo the changes" by using the rollback() method).
setAutoCommit in interface java.sql.Connectionboolean - value indicating if autoCommit is turned on
java.sql.SQLException - is metamatrix access error occurs.
public void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
Metamatrix does not allow setting a catalog through a connection. This method silently ignores the request as per the specification.
setCatalog in interface java.sql.ConnectionThe - string values which sets the catalog name on the connection.
java.sql.SQLException - This should never occur.
public void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.ConnectionA - boolean value specifying whether the connection is readonly.
throws - SQLException.
java.sql.SQLException
protected void commitTransaction(XidImpl arg0,
boolean arg1)
throws java.sql.SQLException
java.sql.SQLException
protected void endTransaction(XidImpl arg0,
int arg1)
throws java.sql.SQLException
java.sql.SQLException
protected void forgetTransaction(XidImpl arg0)
throws java.sql.SQLException
java.sql.SQLException
protected int prepareTransaction(XidImpl arg0)
throws java.sql.SQLException
java.sql.SQLException
protected javax.transaction.xa.Xid[] recoverTransaction(int arg0)
throws java.sql.SQLException
java.sql.SQLException
protected void rollbackTransaction(XidImpl arg0)
throws java.sql.SQLException
java.sql.SQLException
protected void startTransaction(XidImpl arg0,
int arg1,
int timeout)
throws java.sql.SQLException
java.sql.SQLExceptionprotected XidImpl getTransactionXid()
public boolean isValid(int timeout)
throws java.sql.SQLException
isValid in interface java.sql.Connectionjava.sql.SQLExceptionpublic void recycleConnection()
public boolean isSameProcess(ConnectionImpl conn)
throws CommunicationException
CommunicationException
public void setClientInfo(java.util.Properties properties)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoException
public void setClientInfo(java.lang.String name,
java.lang.String value)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoException
public java.util.Properties getClientInfo()
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLException
public java.lang.String getClientInfo(java.lang.String name)
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Array createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
throws java.sql.SQLException
createArrayOf in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Blob createBlob()
throws java.sql.SQLException
createBlob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Clob createClob()
throws java.sql.SQLException
createClob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.NClob createNClob()
throws java.sql.SQLException
createNClob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.SQLXML createSQLXML()
throws java.sql.SQLException
createSQLXML in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Struct createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
throws java.sql.SQLException
createStruct in interface java.sql.Connectionjava.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionjava.sql.SQLException
public void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException
public void setHoldability(int holdability)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String name)
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException
public void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException
public void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||