public abstract class AbstractJdbc3Connection extends AbstractJdbc2Connection
autoCommit, bindStringAsVarchar, firstWarning, metadata, prepareThreshold, readOnly, typemap| Modifier | Constructor and Description |
|---|---|
protected |
AbstractJdbc3Connection(java.lang.String host,
int port,
java.lang.String user,
java.lang.String database,
java.util.Properties info,
java.lang.String url) |
| Modifier and Type | Method and Description |
|---|---|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
abstract 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. |
int |
getHoldability()
Retrieves the current holdability of
ResultSet objects
created using this Connection object. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
abstract java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a
CallableStatement object that will generate
ResultSet objects with the given type and concurrency. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
Creates a default
PreparedStatement object that has
the capability to retrieve auto-generated keys. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
Creates a default
PreparedStatement object capable
of returning the auto-generated keys designated by the given array. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
abstract java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a
PreparedStatement object that will generate
ResultSet objects with the given type, concurrency,
and holdability. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
Creates a default
PreparedStatement object capable
of returning the auto-generated keys designated by the given array. |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
Removes the given
Savepoint object from the current
transaction. |
void |
rollback(java.sql.Savepoint savepoint)
Undoes all changes made after the given
Savepoint object
was set. |
void |
setHoldability(int holdability)
Changes the holdability of
ResultSet objects
created using this Connection object to the given
holdability. |
java.sql.Savepoint |
setSavepoint()
Creates an unnamed savepoint in the current transaction and
returns the new
Savepoint object that represents it. |
java.sql.Savepoint |
setSavepoint(java.lang.String name)
Creates a savepoint with the given name in the current transaction
and returns the new
Savepoint object that represents it. |
addDataType, addDataType, addWarning, cancelQuery, checkClosed, clearWarnings, close, commit, createStatement, createTypeInfo, enableDriverManagerLogging, encodeString, escapeString, execSQLQuery, execSQLQuery, execSQLUpdate, finalize, getAutoCommit, getCatalog, getCopyAPI, getCursorName, getDBVersionNumber, getEncoding, getFastpathAPI, getIsolationLevelName, getLargeObjectAPI, getLogger, getMetaData, getNotifications, getObject, getPrepareThreshold, getProtocolVersion, getQueryExecutor, getServerMajorVersion, getServerMinorVersion, getStandardConformingStrings, getStringVarcharFlag, getTimestampUtils, getTransactionIsolation, getTransactionState, getTypeInfo, getTypeMap, getURL, getUserName, getWarnings, haveMinimumCompatibleVersion, haveMinimumServerVersion, isClosed, isReadOnly, nativeSQL, prepareCall, prepareStatement, rollback, setAutoCommit, setCatalog, setCursorName, setPrepareThreshold, setReadOnly, setTransactionIsolation, setTypeMapImplclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected AbstractJdbc3Connection(java.lang.String host,
int port,
java.lang.String user,
java.lang.String database,
java.util.Properties info,
java.lang.String url)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setHoldability(int holdability)
throws java.sql.SQLException
ResultSet objects
created using this Connection object to the given
holdability.holdability - a ResultSet holdability constant; one of
ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITjava.sql.SQLException - if a database access occurs, the given parameter
is not a ResultSet constant indicating holdability,
or the given holdability is not supportedgetHoldability(),
ResultSetpublic int getHoldability()
throws java.sql.SQLException
ResultSet objects
created using this Connection object.ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITjava.sql.SQLException - if a database access occurssetHoldability(int),
ResultSetpublic java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
Savepoint object that represents it.Savepoint objectjava.sql.SQLException - if a database access error occurs
or this Connection object is currently in
auto-commit modeSavepointpublic java.sql.Savepoint setSavepoint(java.lang.String name)
throws java.sql.SQLException
Savepoint object that represents it.name - a String containing the name of the savepointSavepoint objectjava.sql.SQLException - if a database access error occurs
or this Connection object is currently in
auto-commit modeSavepointpublic void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
Savepoint object
was set.
This method should be used only when auto-commit has been disabled.
savepoint - the Savepoint object to roll back tojava.sql.SQLException - if a database access error occurs,
the Savepoint object is no longer valid,
or this Connection object is currently in
auto-commit modeSavepoint,
rollback(java.sql.Savepoint)public void releaseSavepoint(java.sql.Savepoint savepoint)
throws java.sql.SQLException
Savepoint object from the current
transaction. Any reference to the savepoint after it have been removed
will cause an SQLException to be thrown.savepoint - the Savepoint object to be removedjava.sql.SQLException - if a database access error occurs or
the given Savepoint object is not a valid
savepoint in the current transactionpublic abstract java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
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.resultSetType - one of the following ResultSet
constants:
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - one of the following ResultSet
constants:
ResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLEresultSetHoldability - one of the following ResultSet
constants:
ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITStatement object that will generate
ResultSet objects with the given type,
concurrency, and holdabilityjava.sql.SQLException - if a database access error occurs
or the given parameters are not ResultSet
constants indicating type, concurrency, and holdabilityResultSetpublic java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
createStatement in interface java.sql.ConnectioncreateStatement in class AbstractJdbc2Connectionjava.sql.SQLExceptionpublic abstract java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
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.
sql - a String object that is the SQL statement to
be sent to the database; may contain one or more ? IN
parametersresultSetType - one of the following ResultSet
constants:
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - one of the following ResultSet
constants:
ResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLEresultSetHoldability - one of the following ResultSet
constants:
ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITPreparedStatement object, containing the
pre-compiled SQL statement, that will generate
ResultSet objects with the given type,
concurrency, and holdabilityjava.sql.SQLException - if a database access error occurs
or the given parameters are not ResultSet
constants indicating type, concurrency, and holdabilityResultSetpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareStatement in interface java.sql.ConnectionprepareStatement in class AbstractJdbc2Connectionjava.sql.SQLExceptionpublic abstract java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
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.sql - a String object that is the SQL statement to
be sent to the database; may contain on or more ? parametersresultSetType - one of the following ResultSet
constants:
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - one of the following ResultSet
constants:
ResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLEresultSetHoldability - one of the following ResultSet
constants:
ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITCallableStatement object, containing the
pre-compiled SQL statement, that will generate
ResultSet objects with the given type,
concurrency, and holdabilityjava.sql.SQLException - if a database access error occurs
or the given parameters are not ResultSet
constants indicating type, concurrency, and holdabilityResultSetpublic java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareCall in interface java.sql.ConnectionprepareCall in class AbstractJdbc2Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
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.
sql - an SQL statement that may contain one or more '?' IN
parameter placeholdersautoGeneratedKeys - a flag indicating whether auto-generated keys
should be returned; one of the following Statement
constants:
Statement.RETURN_GENERATED_KEYS or
Statement.NO_GENERATED_KEYS.PreparedStatement object, containing the
pre-compiled SQL statement, that will have the capability of
returning auto-generated keysjava.sql.SQLException - if a database access error occurs
or the given parameter is not a Statement
constant indicating whether auto-generated keys should be
returnedpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
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.
sql - an SQL statement that may contain one or more '?' IN
parameter placeholderscolumnIndexes - an array of column indexes indicating the columns
that should be returned from the inserted row or rowsPreparedStatement object, containing the
pre-compiled statement, that is capable of returning the
auto-generated keys designated by the given array of column
indexesjava.sql.SQLException - if a database access error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
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.
sql - an SQL statement that may contain one or more '?' IN
parameter placeholderscolumnNames - an array of column names indicating the columns
that should be returned from the inserted row or rowsPreparedStatement object, containing the
pre-compiled statement, that is capable of returning the
auto-generated keys designated by the given array of column
namesjava.sql.SQLException - if a database access error occurs