| java.lang.Object org.continuent.sequoia.driver.Connection
Method Summary | |
protected synchronized ResultAndWarnings | callableStatementExecute(RequestWithResultSetParameters proc) Call a stored procedure that returns a list of results.
Parameters: proc - the stored procedure call a List composed of 1. | protected synchronized ResultAndWarnings | callableStatementExecuteQuery(RequestWithResultSetParameters proc) Call a stored procedure (with IN/OUT and/or named parameters) that returns
a ResultSet. | protected synchronized ResultAndWarnings | callableStatementExecuteUpdate(Request proc) Call a stored procedure that performs an update. | public void | clearWarnings() After this call, getWarnings() returns null
until a new call to getWarnings() on this connection. | public void | close() Releases the connection. | protected synchronized void | closeRemoteResultSet(String cursorName) Closes the remote ResultSet given its cursor name. | public synchronized void | commit() Makes all changes made since the previous commit/rollback permanent and
releases any database locks currently held by the Connection .
This method should only be used when auto-commit has been disabled. | protected SQLWarning | convertToSQLWarnings(SerializableException toConvert) | public java.sql.Statement | createStatement() SQL statements without parameters are normally executed using
Statement objects. | public java.sql.Statement | createStatement(int resultSetType, int resultSetConcurrency) SQL statements without parameters are normally executed using
Statement objects. | public java.sql.Statement | createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) Creates a Statement object that will generate
ResultSet objects with the given type, concurrency, and
holdability. | protected synchronized ResultSet | getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) | public boolean | getAutoCommit() Gets the current auto-commit state. | protected synchronized ResultSet | getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) | public synchronized String | getCatalog() Return current catalog name. | public synchronized ResultSet | getCatalogs() getCatalogs definition. | protected synchronized ResultSet | getColumnPrivileges(String catalog, String schemaPattern, String tableName, String columnNamePattern) | protected synchronized ResultSet | getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) | public ControllerInfo | getControllerInfo() | protected synchronized String | getControllerVersionNumber() Get the Sequoia controller version number. | protected synchronized ResultSet | getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) | static String | getCurrentMethodName() Gets the caller's method name. | protected synchronized String | getDatabaseProductName() | public String | getEscapeChar() | protected synchronized ResultSet | getExportedKeys(String catalog, String schema, String table) | public int | getHoldability() Retrieves the current holdability of ResultSet objects
created using this Connection object. | protected synchronized ResultSet | getImportedKeys(String catalog, String schema, String table) | protected synchronized ResultSet | getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) | public java.sql.DatabaseMetaData | getMetaData() A connection's database is able to provide information describing its
tables, its supported SQL grammar, its stored procedures, the capabilities
of this connection, etc. | public String | getPassword() Gets the password used to login to the database. | protected synchronized ResultSet | getPrimaryKeys(String catalog, String schemaPattern, String tableNamePattern) | protected synchronized java.sql.ResultSet | getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) | protected synchronized java.sql.ResultSet | getProcedures(String catalog, String schemaPattern, String procedureNamePattern) | protected synchronized ResultSet | getSchemas() | SequoiaUrl | getSequoiaUrl() | protected synchronized Object | getStaticMetadata(String key) Retrieve a static metadata from the controller. | protected synchronized ResultSet | getSuperTables(String catalog, String schemaPattern, String tableNamePattern) | protected synchronized ResultSet | getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) | protected synchronized ResultSet | getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) Gets a description of the access rights for each table available in a
catalog. | protected synchronized ResultSet | getTableTypes() Gets the table types available in this database. | protected synchronized ResultSet | getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) | public int | getTransactionIsolation() Gets this Connection's current transaction isolation mode. | protected synchronized ResultSet | getTypeInfo() | public java.util.Map | getTypeMap() Sequoia does NOT support type map. | protected synchronized ResultSet | getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) | public String | getUrl() | public String | getUserName() Gets the user name used to login to the database. | protected synchronized ResultSet | getVersionColumns(String catalog, String schema, String table) | public SQLWarning | getWarnings() Returns the first warning reported by calls on this connection. | boolean | isAlwaysGettingGeneratedKeys() Returns the alwaysGetGeneratedKeys value. | public boolean | isClosed() Returns true if the connection has been closed by the user
(but Sequoia may leave it open underneath, unknown to the user). | public boolean | isConnectionPooling() Returns the connectionPooling value. | public boolean | isEscapeBackslash() Returns the escapeBackslash value. | public boolean | isEscapeSingleQuote() Returns the escapeSingleQuote value. | public boolean | isReadOnly() Tests to see if the connection is in read only Mode. | public String | nativeSQL(String query) As we can't know for sure which database will execute this request (now or
later), we can't translate it in the native query language of the
underlying DBMS. | public java.sql.CallableStatement | prepareCall(String sql) Creates a CallableStatement that contains sql and produces a ResultSet that
is TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY. | public java.sql.CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency) | public java.sql.CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Creates a CallableStatement object that will generate
ResultSet objects with the given type and concurrency. | public java.sql.PreparedStatement | prepareStatement(String sql) A SQL statement with or without IN parameters can be
pre-compiled and stored in a PreparedStatement object. | public java.sql.PreparedStatement | prepareStatement(String sql, int autoGeneratedKeys) Creates a default PreparedStatement object that has the
capability to retrieve auto-generated keys. | public java.sql.PreparedStatement | prepareStatement(String sql, int[] columnIndexes) Creates a default PreparedStatement object capable of
returning the auto-generated keys designated by the given array. | public java.sql.PreparedStatement | prepareStatement(String sql, String[] columnNames) Creates a default PreparedStatement object capable of
returning the auto-generated keys designated by the given array. | public java.sql.PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency) A SQL statement with or without IN parameters can be pre-compiled and
stored in a PreparedStatement object. | public java.sql.PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Creates a PreparedStatement object that will generate
ResultSet objects with the given type, concurrency, and
holdability. | protected synchronized ResultSetMetaData | preparedStatementGetMetaData(String sqlTemplate) | void | reallyClose() | public void | releaseSavepoint(Savepoint savepoint) Removes the given Savepoint object from the current
transaction. | public synchronized void | rollback() Drops all changes made since the previous commit/rollback and releases any
database locks currently held by this connection. | public void | rollback(Savepoint savepoint) Undoes all changes made after the given Savepoint object was
set. | public synchronized void | setAutoCommit(boolean autoCommitArg) To keep track of active transactions, sequoia uses the old BEGIN modeless
model. | public synchronized void | setCatalog(String catalog) | public void | setConnectionPooling(boolean connectionPooling) Sets the connectionPooling value. | public void | setEscapeBackslash(boolean escapeBackslash) Sets the escapeBackslash value. | public void | setEscapeChar(String escapeChar) | public void | setEscapeSingleQuote(boolean escapeSingleQuote) Sets the escapeSingleQuote value. | public void | setHoldability(int holdability) Changes the holdability of ResultSet objects created using
this Connection object to the given holdability. | public void | setReadOnly(boolean readOnly) | public Savepoint | setSavepoint() Creates an unnamed savepoint in the current transaction and returns the new
Savepoint object that represents it. | public Savepoint | setSavepoint(String name) Creates a savepoint with the given name in the current transaction and
returns the new Savepoint object that represents it. | public synchronized void | setTransactionIsolation(int level) You can call this method to try to change the transaction isolation level
using one of the TRANSACTION_* values.
Note: this method cannot be called while in the middle of a
transaction. | public void | setTypeMap(java.util.Map map) Sequoia does NOT support type map. | protected synchronized ResultAndWarnings | statementExecute(RequestWithResultSetParameters request) Call a request that returns a list of results. | protected synchronized DriverResultSet | statementExecuteQuery(RequestWithResultSetParameters request) Performs a read request and return the reply. | protected synchronized ResultAndWarnings | statementExecuteUpdate(Request request) Performs a write request and return the number of rows affected. | protected synchronized DriverGeneratedKeysResult | statementExecuteUpdateWithKeys(Request request) | public String | toString() | protected synchronized void | tryFetchNext(String cursorName, int fetchSize) Send "FetchNextResultSetRows" command to controller. |
DEFAULT_TRANSACTION_ISOLATION_LEVEL | final public static int DEFAULT_TRANSACTION_ISOLATION_LEVEL(Code) | | Default transaction isolation level if the user has not enforced one
|
autoCommit | protected boolean autoCommit(Code) | | Commit mode of the connection (true = automatic).
|
escapeBackslash | protected boolean escapeBackslash(Code) | | |
escapeSingleQuote | protected boolean escapeSingleQuote(Code) | | |
firstWarning | protected SQLWarning firstWarning(Code) | | List of Warnings for this connection.
|
holdability | protected int holdability(Code) | | ResultSet holdability (JDBC 3)
|
isClosed | protected boolean isClosed(Code) | | Status of the connection.
|
isolationLevel | protected int isolationLevel(Code) | | Current transaction isolation level.
|
readOnly | protected boolean readOnly(Code) | | Is the connection in read-only mode ?
|
socket | protected Socket socket(Code) | | Connection with the controller.
|
transactionId | protected long transactionId(Code) | | transaction identifier.
|
vdbUser | protected String vdbUser(Code) | | Virtual database user used for this connection.
|
writeExecutedInTransaction | boolean writeExecutedInTransaction(Code) | | Has a write request been executed in the current transaction?
|
callableStatementExecuteQuery | protected synchronized ResultAndWarnings callableStatementExecuteQuery(RequestWithResultSetParameters proc) throws DriverSQLException(Code) | | Call a stored procedure (with IN/OUT and/or named parameters) that returns
a ResultSet.
Parameters: proc - the stored procedure call a List composed of a java.sql.ResultSet value, anArrayList of OUT parameters, and aHashMap of named parameters result objects. exception: DriverSQLException - if an error occurs |
callableStatementExecuteUpdate | protected synchronized ResultAndWarnings callableStatementExecuteUpdate(Request proc) throws DriverSQLException(Code) | | Call a stored procedure that performs an update.
Parameters: proc - the stored procedure call a List composed of an Integer (number of updated rows), anArrayList of OUT parameters, and aHashMap of named parameters result objects. exception: DriverSQLException - if an error occurs |
clearWarnings | public void clearWarnings() throws SQLException(Code) | | After this call, getWarnings() returns null
until a new call to getWarnings() on this connection.
exception: SQLException - if a database access error occurs |
close | public void close() throws DriverSQLException(Code) | | Releases the connection. In fact, the connection is marked to be released
but will be effectively closed by the ConnectionClosingThread
if the connection has not been reused before.
exception: DriverSQLException - if an error occurs |
closeRemoteResultSet | protected synchronized void closeRemoteResultSet(String cursorName) throws SQLException(Code) | | Closes the remote ResultSet given its cursor name.
Parameters: cursorName - cursor name of the ResultSet to close. throws: SQLException - if an error occurs |
commit | public synchronized void commit() throws DriverSQLException(Code) | | Makes all changes made since the previous commit/rollback permanent and
releases any database locks currently held by the Connection .
This method should only be used when auto-commit has been disabled. (If
autoCommit == true , then we throw a
DriverSQLException).
exception: DriverSQLException - if a database access error occurs or theconnection is in autocommit mode See Also: Connection.setAutoCommit(boolean) |
convertToSQLWarnings | protected SQLWarning convertToSQLWarnings(SerializableException toConvert)(Code) | | Utility function to convert the given chain of backendException to a chain
of SQLWarnings
Parameters: toConvert - exception chain to convert |
createStatement | public java.sql.Statement createStatement() throws DriverSQLException(Code) | | SQL statements without parameters are normally executed using
Statement objects. If the same SQL statement is executed
many times, it is more efficient to use a PreparedStatement .
The ResultSet will be
TYPE_FORWARD_ONLY/CONCUR_READ_ONLY .
a new Statement object exception: DriverSQLException - passed through from the constructor |
createStatement | public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | SQL statements without parameters are normally executed using
Statement objects. If the same SQL statement is executed
many times, it is more efficient to use a PreparedStatement .
Parameters: resultSetType - resultSetType to use Parameters: resultSetConcurrency - resultSetConcurrency to use a new Statement object exception: SQLException - passed through from the constructor |
createStatement | public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code) | | Creates a Statement object that will generate
ResultSet objects with the given type, concurrency, and
holdability.
This method is the same as the createStatement method above,
but it allows the default result set type, concurrency, and holdability to
be overridden.
Parameters: resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY ,ResultSet.TYPE_SCROLL_INSENSITIVE , orResultSet.TYPE_SCROLL_SENSITIVE Parameters: resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY orResultSet.CONCUR_UPDATABLE Parameters: resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT orResultSet.CLOSE_CURSORS_AT_COMMIT a new Statement object that will generateResultSet objects with the given type, concurrency,and holdability exception: SQLException - if a database access error occurs or the givenparameters are not ResultSet constantsindicating type, concurrency, and holdability See Also: ResultSet since: JDK 1.4 |
getControllerInfo | public ControllerInfo getControllerInfo()(Code) | | Get the information about the controller we are connected to
ControllerInfo object of the controller |
getControllerVersionNumber | protected synchronized String getControllerVersionNumber() throws DriverSQLException(Code) | | Get the Sequoia controller version number.
a String containing the controller version exception: DriverSQLException - if an error occurs |
getCurrentMethodName | static String getCurrentMethodName()(Code) | | Gets the caller's method name.
method name of the calling function |
getEscapeChar | public String getEscapeChar()(Code) | | Returns the escapeChar. |
getHoldability | public int getHoldability() throws SQLException(Code) | | Retrieves the current holdability of ResultSet objects
created using this Connection object. If the value was not
set using setHoldability(), the default value of the database is returned.
the holdability, one ofResultSet.HOLD_CURSORS_OVER_COMMIT orResultSet.CLOSE_CURSORS_AT_COMMIT throws: SQLException - if a database access occurs See Also: Connection.setHoldability See Also: ResultSet since: JDK 1.4 |
getMetaData | public java.sql.DatabaseMetaData getMetaData() throws DriverSQLException(Code) | | A connection's database is able to provide information describing its
tables, its supported SQL grammar, its stored procedures, the capabilities
of this connection, etc. This information is made available through a
DatabaseMetaData object.
a DatabaseMetaData object for this connection exception: DriverSQLException - if connection is closed |
getPassword | public String getPassword()(Code) | | Gets the password used to login to the database.
password |
getSequoiaUrl | SequoiaUrl getSequoiaUrl()(Code) | | Gets the parsed Sequoia URL, including merged properties
the parsed Sequoia URL |
getTablePrivileges | protected synchronized ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws DriverSQLException(Code) | | Gets a description of the access rights for each table available in a
catalog. Note that a table privilege applies to one or more columns in the
table. It would be wrong to assume that this priviledge applies to all
columns (this may be true for some systems but is not true for all.) Only
privileges matching the schema and table name criteria are returned. They
are ordered by TABLE_SCHEM, TABLE_NAME, and PRIVILEGE.
Parameters: catalog - a catalog name; "" retrieves those without a catalog; nullmeans drop catalog name from the selection criteria Parameters: schemaPattern - a schema name pattern; "" retrieves those without aschema Parameters: tableNamePattern - a table name pattern ResultSet each row is a table privilege description throws: DriverSQLException - if a database access error occurs |
getTableTypes | protected synchronized ResultSet getTableTypes() throws SQLException(Code) | | Gets the table types available in this database. The results are ordered by
table type.
ResultSet each row has a single String column thatis a catalog name throws: SQLException - if a database error occurs |
getTransactionIsolation | public int getTransactionIsolation() throws DriverSQLException(Code) | | Gets this Connection's current transaction isolation mode. If the
transaction isolation has not been set using setTransactionIsolation, this
method will return by default
java.sql.Connection.TRANSACTION_READ_UNCOMMITTED whatever transaction
isolation is really used by the cluster nodes. If you want to enfore
TRANSACTION_READ_UNCOMMITTED, you have to explicitely call
setTransactionIsolation(java.sql.Connection.TRANSACTION_READ_UNCOMMITTED)
the current TRANSACTION_* mode value exception: DriverSQLException - if a database access error occurs See Also: Connection.setTransactionIsolation(int) |
getUrl | public String getUrl()(Code) | | Gets the untouched String URL that was passed by the client application
value of url. |
getUserName | public String getUserName()(Code) | | Gets the user name used to login to the database.
login name |
getWarnings | public SQLWarning getWarnings() throws DriverSQLException(Code) | | Returns the first warning reported by calls on this connection. Subsequent
warnings will be chained to this SQLWarning
Note: If the 'persistent connections' option is set to false, this
function will always return null.
the first SQLWarning or null exception: DriverSQLException - if a database access error occurs or thismethod is called on a closed connection |
isAlwaysGettingGeneratedKeys | boolean isAlwaysGettingGeneratedKeys()(Code) | | Returns the alwaysGetGeneratedKeys value.
Returns the alwaysGetGeneratedKeys. |
isClosed | public boolean isClosed()(Code) | | Returns true if the connection has been closed by the user
(but Sequoia may leave it open underneath, unknown to the user).
true if connection has never been opened orclose() has been called |
isConnectionPooling | public boolean isConnectionPooling()(Code) | | Returns the connectionPooling value.
Returns the connectionPooling. |
isEscapeBackslash | public boolean isEscapeBackslash()(Code) | | Returns the escapeBackslash value.
Returns the escapeBackslash. |
isEscapeSingleQuote | public boolean isEscapeSingleQuote()(Code) | | Returns the escapeSingleQuote value.
Returns the escapeSingleQuote. |
isReadOnly | public boolean isReadOnly()(Code) | | Tests to see if the connection is in read only Mode. Note that we cannot
really put the database in read only mode, but we pretend we can by
returning the value of the readOnly flag.
true if the connection is read only |
nativeSQL | public String nativeSQL(String query)(Code) | | As we can't know for sure which database will execute this request (now or
later), we can't translate it in the native query language of the
underlying DBMS. Therefore the query is returned unchanged.
Parameters: query - the query to change the original query |
prepareCall | public java.sql.CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code) | | Creates a CallableStatement object that will generate
ResultSet objects with the given type and concurrency. This
method is the same as the prepareCall method above, but it
allows the default result set type, result set concurrency type and
holdability to be overridden.
Parameters: sql - a String object that is the SQL statement to besent to the database; may contain on or more ? parameters Parameters: resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY ,ResultSet.TYPE_SCROLL_INSENSITIVE , orResultSet.TYPE_SCROLL_SENSITIVE Parameters: resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY orResultSet.CONCUR_UPDATABLE Parameters: resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT orResultSet.CLOSE_CURSORS_AT_COMMIT a new CallableStatement object, containing thepre-compiled SQL statement, that will generateResultSet objects with the given type, concurrency,and holdability exception: SQLException - if a database access error occurs or the givenparameters are not ResultSet constantsindicating type, concurrency, and holdability See Also: ResultSet since: JDK 1.4 |
prepareStatement | public java.sql.PreparedStatement prepareStatement(String sql) throws SQLException(Code) | | A SQL statement with or without IN parameters can be
pre-compiled and stored in a PreparedStatement object. This object can then
be used to efficiently execute this statement multiple times.
Parameters: sql - a SQL statement that may contain one or more '?' IN * parameterplaceholders a new PreparedStatement object containing thepre-compiled statement. exception: SQLException - if a database access error occurs. |
prepareStatement | public java.sql.PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException(Code) | | Creates a default PreparedStatement object that has the
capability to retrieve auto-generated keys. The given constant tells the
driver whether it should make auto-generated keys available for retrieval.
This parameter is ignored if the SQL statement is not an
INSERT statement.
Note: This method is optimized for handling parametric SQL
statements that benefit from precompilation. If the driver supports
precompilation, the method prepareStatement will send the
statement to the database for precompilation. Some drivers may not support
precompilation. In this case, the statement may not be sent to the database
until the PreparedStatement object is executed. This has no
direct effect on users; however, it does affect which methods throw certain
SQLExceptions.
Result sets created using the returned PreparedStatement
object will by default be type TYPE_FORWARD_ONLY and have a
concurrency level of CONCUR_READ_ONLY .
Parameters: sql - an SQL statement that may contain one or more '?' IN parameterplaceholders Parameters: autoGeneratedKeys - a flag indicating whether auto-generated keysshould be returned; one ofStatement.RETURN_GENERATED_KEYS orStatement.NO_GENERATED_KEYS a new PreparedStatement object, containing thepre-compiled SQL statement, that will have the capability ofreturning auto-generated keys exception: SQLException - if a database access error occurs or the givenparameter is not a Statement constantindicating whether auto-generated keys should be returned since: JDK 1.4 |
prepareStatement | public java.sql.PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException(Code) | | Creates a default PreparedStatement object capable of
returning the auto-generated keys designated by the given array. This array
contains the indexes of the columns in the target table that contain the
auto-generated keys that should be made available. This array is ignored if
the SQL statement is not an INSERT statement.
An SQL statement with or without IN parameters can be pre-compiled and
stored in a PreparedStatement object. This object can then
be used to efficiently execute this statement multiple times.
Note: This method is optimized for handling parametric SQL
statements that benefit from precompilation. If the driver supports
precompilation, the method prepareStatement will send the
statement to the database for precompilation. Some drivers may not support
precompilation. In this case, the statement may not be sent to the database
until the PreparedStatement object is executed. This has no
direct effect on users; however, it does affect which methods throw certain
SQLExceptions.
Result sets created using the returned PreparedStatement
object will by default be type TYPE_FORWARD_ONLY and have a
concurrency level of CONCUR_READ_ONLY .
Parameters: sql - an SQL statement that may contain one or more '?' IN parameterplaceholders Parameters: columnIndexes - an array of column indexes indicating the columns thatshould be returned from the inserted row or rows a new PreparedStatement object, containing thepre-compiled statement, that is capable of returning theauto-generated keys designated by the given array of column indexes exception: SQLException - if a database access error occurs since: JDK 1.4 |
prepareStatement | public java.sql.PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException(Code) | | Creates a default PreparedStatement object capable of
returning the auto-generated keys designated by the given array. This array
contains the names of the columns in the target table that contain the
auto-generated keys that should be returned. This array is ignored if the
SQL statement is not an INSERT statement.
An SQL statement with or without IN parameters can be pre-compiled and
stored in a PreparedStatement object. This object can then
be used to efficiently execute this statement multiple times.
Note: This method is optimized for handling parametric SQL
statements that benefit from precompilation. If the driver supports
precompilation, the method prepareStatement will send the
statement to the database for precompilation. Some drivers may not support
precompilation. In this case, the statement may not be sent to the database
until the PreparedStatement object is executed. This has no
direct effect on users; however, it does affect which methods throw certain
SQLExceptions .
Result sets created using the returned PreparedStatement
object will by default be type TYPE_FORWARD_ONLY and have a
concurrency level of CONCUR_READ_ONLY .
Parameters: sql - an SQL statement that may contain one or more '?' IN parameterplaceholders Parameters: columnNames - an array of column names indicating the columns thatshould be returned from the inserted row or rows a new PreparedStatement object, containing thepre-compiled statement, that is capable of returning theauto-generated keys designated by the given array of column names exception: SQLException - if a database access error occurs since: JDK 1.4 |
prepareStatement | public java.sql.PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | A SQL statement with or without IN parameters can be pre-compiled and
stored in a PreparedStatement object. This object can then
be used to efficiently execute this statement multiple times.
Parameters: sql - a SQL statement that may contain one or more '?' IN Parameters: resultSetType - ResultSetType to use Parameters: resultSetConcurrency - ResultSetConcurrency to use a new PreparedStatement object exception: SQLException - passed through from the constructor |
prepareStatement | public java.sql.PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code) | | Creates a PreparedStatement object that will generate
ResultSet objects with the given type, concurrency, and
holdability.
This method is the same as the prepareStatement method
above, but it allows the default result set type, concurrency, and
holdability to be overridden.
Parameters: sql - a String object that is the SQL statement to besent to the database; may contain one or more ? IN parameters Parameters: resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY ,ResultSet.TYPE_SCROLL_INSENSITIVE , orResultSet.TYPE_SCROLL_SENSITIVE Parameters: resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY orResultSet.CONCUR_UPDATABLE Parameters: resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT orResultSet.CLOSE_CURSORS_AT_COMMIT a new PreparedStatement object, containing thepre-compiled SQL statement, that will generateResultSet objects with the given type, concurrency,and holdability exception: SQLException - if a database access error occurs or the givenparameters are not ResultSet constantsindicating type, concurrency, and holdability See Also: ResultSet since: JDK 1.4 |
releaseSavepoint | public void releaseSavepoint(Savepoint savepoint) throws DriverSQLException(Code) | | Removes the given Savepoint object from the current
transaction. Any reference to the savepoint after it have been removed will
cause an SQLException to be thrown.
Parameters: savepoint - the Savepoint object to be removed exception: DriverSQLException - if a database access error occurs or thegiven Savepoint object is not a valid savepointin the current transaction since: JDK 1.4 |
rollback | public synchronized void rollback() throws DriverSQLException(Code) | | Drops all changes made since the previous commit/rollback and releases any
database locks currently held by this connection. If the connection was in
autocommit mode, we throw a DriverSQLException.
exception: DriverSQLException - if a database access error occurs or theconnection is in autocommit mode See Also: Connection.commit |
rollback | public void rollback(Savepoint savepoint) throws DriverSQLException(Code) | | Undoes all changes made after the given Savepoint object was
set.
This method should be used only when auto-commit has been disabled.
Parameters: savepoint - the Savepoint object to roll back to exception: DriverSQLException - if a database access error occurs, theSavepoint object is no longer valid, or thisConnection object is currently in auto-commitmode See Also: Savepoint See Also: Connection.rollback() since: JDK 1.4 |
setAutoCommit | public synchronized void setAutoCommit(boolean autoCommitArg) throws DriverSQLException, DriverIOException(Code) | | To keep track of active transactions, sequoia uses the old BEGIN modeless
model. Backend's connections on the controller are always maintained/reset
in autocommit mode = true, except of course when in the middle of an active
transaction. So part of our job here is to translate the new ODBC/JDBC
autoCommit mode concept to the old BEGIN model.
See Also: Commands.SetAutoCommit See Also: java.sql.Connection.setAutoCommit(boolean) Parameters: autoCommitArg - true enables auto-commit;false disables it exception: DriverSQLException - if a database access error occurs throws: DriverIOException - if an IO error occured with the controller |
setCatalog | public synchronized void setCatalog(String catalog) throws SQLException(Code) | | Change the current catalog
Parameters: catalog - a String value exception: SQLException - if fails or if catalog name is invalid |
setConnectionPooling | public void setConnectionPooling(boolean connectionPooling)(Code) | | Sets the connectionPooling value.
Parameters: connectionPooling - The connectionPooling to set. |
setEscapeBackslash | public void setEscapeBackslash(boolean escapeBackslash)(Code) | | Sets the escapeBackslash value.
Parameters: escapeBackslash - The escapeBackslash to set. |
setEscapeChar | public void setEscapeChar(String escapeChar)(Code) | | Sets the escapeCharacter value
Parameters: escapeChar - the escapeChar value to set |
setEscapeSingleQuote | public void setEscapeSingleQuote(boolean escapeSingleQuote)(Code) | | Sets the escapeSingleQuote value.
Parameters: escapeSingleQuote - The escapeSingleQuote to set. |
setHoldability | public void setHoldability(int holdability) throws SQLException(Code) | | Changes the holdability of ResultSet objects created using
this Connection object to the given holdability.
Parameters: holdability - a ResultSet holdability constant; one ofResultSet.HOLD_CURSORS_OVER_COMMIT orResultSet.CLOSE_CURSORS_AT_COMMIT throws: SQLException - if a database access occurs, the given parameter isnot a ResultSet constant indicating holdability,or the given holdability is not supported See Also: Connection.getHoldability See Also: ResultSet since: JDK 1.4 |
setReadOnly | public void setReadOnly(boolean readOnly) throws DriverSQLException(Code) | | You can put a connection in read-only mode as a hint to enable database
optimizations
Parameters: readOnly - true enables read-only mode;false disables it exception: DriverSQLException - if a database access error occurs |
setSavepoint | public Savepoint setSavepoint() throws DriverSQLException(Code) | | Creates an unnamed savepoint in the current transaction and returns the new
Savepoint object that represents it.
the new Savepoint object exception: DriverSQLException - if a database access error occurs or thisConnection object is currently in auto-commitmode See Also: Savepoint since: JDK 1.4 |
setSavepoint | public Savepoint setSavepoint(String name) throws DriverSQLException(Code) | | Creates a savepoint with the given name in the current transaction and
returns the new Savepoint object that represents it.
Parameters: name - a String containing the name of the savepoint the new Savepoint object exception: DriverSQLException - if a database access error occurs or thisConnection object is currently in auto-commitmode See Also: Savepoint since: JDK 1.4 |
setTransactionIsolation | public synchronized void setTransactionIsolation(int level) throws DriverSQLException(Code) | | You can call this method to try to change the transaction isolation level
using one of the TRANSACTION_* values.
Note: this method cannot be called while in the middle of a
transaction. The JDBC spec says it should trigger a commit. We should
probably let the backend handle this, not trying to add our own complexity.
Parameters: level - one of the TRANSACTION_* isolation values with * the exceptionof TRANSACTION_NONE; some databases may * not support other values exception: DriverSQLException - if a database access error occurs See Also: java.sql.DatabaseMetaData.supportsTransactionIsolationLevel |
|
|