public abstract class AS400JDBCConnection
extends java.lang.Object
implements java.sql.Connection
The AS400JDBCConnection interface provides base class used by all JDBC connection objects in JTOpen.
Modifier and Type | Field and Description |
---|---|
protected boolean |
inFinalizer_ |
Constructor and Description |
---|
AS400JDBCConnection() |
Modifier and Type | Method and Description |
---|---|
abstract void |
clearWarnings()
Clears all warnings that have been reported for the connection.
|
abstract void |
close()
Releases the connection's resources immediately instead of waiting
for them to be automatically released.
|
abstract void |
commit()
Commits all changes made since the previous commit or
rollback and releases any database locks currently held by
the connection.
|
abstract java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
Factory method for creating Array objects.
|
abstract java.sql.Blob |
createBlob()
Constructs an object that implements the
Blob interface. |
abstract java.sql.Clob |
createClob()
Constructs an object that implements the
Clob interface. |
abstract java.sql.Statement |
createStatement()
Creates a Statement object for executing SQL statements without
parameters.
|
abstract java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Creates a Statement object for executing SQL statements without
parameters.
|
abstract java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a Statement object for executing SQL statements without
parameters.
|
abstract java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
Factory method for creating Struct objects.
|
abstract boolean |
doUpdateDeleteBlocking() |
abstract void |
dumpStatementCreationLocation() |
abstract boolean |
getAutoCommit()
Returns the auto-commit state.
|
abstract java.lang.String |
getCatalog()
Returns the catalog name.
|
abstract java.util.Properties |
getClientInfo()
Returns a list containing the name and current value of each client info
property supported by the driver.
|
abstract java.lang.String |
getClientInfo(java.lang.String name)
Returns the value of the client info property specified by name.
|
abstract int |
getConcurrentAccessResolution()
This method returns the concurrent access resolution setting.
|
abstract int |
getHoldability()
Returns the holdability of ResultSets created from this connection.
|
abstract int |
getMaximumBlockedInputRows() |
abstract java.sql.DatabaseMetaData |
getMetaData()
Returns the DatabaseMetaData object that describes the
connection's tables, supported SQL grammar, stored procedures,
capabilities and more.
|
abstract int |
getNetworkTimeout()
Retrieves the number of milliseconds the driver will wait for a database request to complete.
|
abstract JDProperties |
getProperties()
Returns the connection properties.
|
abstract java.lang.String[] |
getReconnectURLs()
Returns a String array containing the URLs that are used when to
reconnect to a system when the "enableClientAffinities" property
is set.
|
abstract java.lang.String |
getSchema()
Retrieves this
Connection object's current schema name. |
abstract java.lang.String |
getServerJobIdentifier()
Returns the job identifier of the host server job corresponding to this connection.
|
abstract AS400 |
getSystem()
Returns the system object which is managing the connection to the system.
|
abstract int |
getTransactionIsolation()
Returns the transaction isolation level.
|
abstract java.util.Map |
getTypeMap()
Returns the type map.
|
abstract java.sql.SQLWarning |
getWarnings()
Returns the first warning reported for the connection.
|
abstract boolean |
isClosed()
Indicates if the connection is closed.
|
abstract boolean |
isReadOnly()
Indicates if the connection is in read-only mode.
|
abstract java.lang.String |
nativeSQL(java.lang.String sql)
Returns the native form of an SQL statement without
executing it.
|
abstract java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Precompiles an SQL stored procedure call with optional input
and output parameters and stores it in a CallableStatement
object.
|
abstract java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Precompiles an SQL stored procedure call with optional input
and output parameters and stores it in a CallableStatement
object.
|
abstract java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Precompiles an SQL stored procedure call with optional input
and output parameters and stores it in a CallableStatement
object.
|
abstract java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
abstract java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
abstract java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
abstract java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
abstract java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
abstract java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
abstract void |
releaseSavepoint(java.sql.Savepoint savepoint)
Removes the given Savepoint object from the current transaction.
|
abstract void |
rollback()
Drops all changes made since the previous commit or
rollback and releases any database locks currently held by
the connection.
|
abstract void |
rollback(java.sql.Savepoint savepoint)
Undoes all changes made after the specified Savepoint was set.
|
abstract void |
setAutoCommit(boolean autoCommit)
Sets the auto-commit mode.
|
abstract void |
setCatalog(java.lang.String catalog)
This method is not supported.
|
abstract void |
setClientInfo(java.util.Properties properties)
Sets the value of the connection's client info properties.
|
abstract void |
setClientInfo(java.lang.String name,
java.lang.String value)
Sets the value of the client info property specified by name to the
value specified by value.
|
abstract void |
setConcurrentAccessResolution(int concurrentAccessResolution)
This method sets concurrent access resolution.
|
abstract void |
setDB2eWLMCorrelator(byte[] bytes)
Sets the eWLM Correlator.
|
abstract void |
setDBHostServerTrace(boolean trace)
Starts or stops the Database Host Server trace for this connection.
|
abstract void |
setDisableCompression(boolean disableCompression_) |
abstract void |
setHoldability(int holdability)
Sets the holdability of ResultSets created from this connection.
|
void |
setInFinalizer(boolean setting) |
abstract void |
setNetworkTimeout(int timeout)
Sets the maximum period a Connection or objects created from the Connection will wait for the database to
reply to any one request.
|
abstract void |
setReadOnly(boolean readOnly)
Sets the read-only mode.
|
abstract java.sql.Savepoint |
setSavepoint()
Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.
|
abstract java.sql.Savepoint |
setSavepoint(java.lang.String name)
Creates a named savepoint in the current transaction and returns the new Savepoint object that represents it.
|
abstract void |
setSchema(java.lang.String schema)
Sets the given schema name to access.
|
abstract void |
setTransactionIsolation(int level)
Sets the transaction isolation level.
|
abstract void |
setTypeMap(java.util.Map typeMap)
Sets the type map to be used for distinct and structured
types.
|
abstract java.lang.String |
toString()
Returns the connection's catalog name.
|
public abstract void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
- If an error occurs.public abstract void close() throws java.sql.SQLException
close
in interface java.sql.Connection
java.sql.SQLException
- If an error occurs.public abstract void commit() throws java.sql.SQLException
This method can not be called when the connection is part of a distributed transaction. See AS400JDBCXAResource for more information.
commit
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open
or an error occurs.public abstract java.sql.Statement createStatement() throws java.sql.SQLException
Result sets created using the statement will be type ResultSet.TYPE_FORWARD_ONLY and concurrency ResultSet.CONCUR_READ_ONLY.
createStatement
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, or an
error occurs.public abstract java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
resultSetType
- The result set type. Valid values are:
resultSetConcurrency
- The result set concurrency. Valid values are:
java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, the
result type or currency is not supported,
or an error occurs.public abstract java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
Full functionality of this method requires support in OS/400 V5R2 or IBM i. If connecting to OS/400 V5R1 or earlier, the value for resultSetHoldability will be ignored.
createStatement
in interface java.sql.Connection
resultSetType
- The result set type. Valid values are:
resultSetConcurrency
- The result set concurrency. Valid values are:
resultSetHoldability
- The result set holdability. Valid values are:
java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, the
result type, currency, or holdability is not supported,
or an error occurs.public abstract boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open.public abstract java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open.public abstract int getConcurrentAccessResolution()
AS400JDBCDataSource.CONCURRENTACCESS_NOT_SET
,
AS400JDBCDataSource.CONCURRENTACCESS_USE_CURRENTLY_COMMITTED
,
AS400JDBCDataSource.CONCURRENTACCESS_WAIT_FOR_OUTCOME
and
AS400JDBCDataSource.CONCURRENTACCESS_SKIP_LOCKS
,
with the property defaulting to AS400JDBCDataSource.CONCURRENTACCESS_NOT_SET
.
Setting this property to default exhibits the default behavior on the servers
i.e., the semantic applied for read
transactions to avoid locks will be determined by the server.
AS400JDBCDataSource.CONCURRENTACCESS_USE_CURRENTLY_COMMITTED
specifies that driver will flow USE CURRENTLY COMMITTED
to server. Whether CURRENTLY COMMITTED will actually be in effect is
ultimately determined by server.
AS400JDBCDataSource.CONCURRENTACCESS_WAIT_FOR_OUTCOME
specifies that driver will flow WAIT FOR OUTCOME
to server. This will disable the CURRENTLY COMMITTED behavior at the server,
if enabled, and the server will wait for the commit or rollback of data in the process of
being updated.
AS400JDBCDataSource.CONCURRENTACCESS_SKIP_LOCKS
specifies that driver will flow SKIP LOCKS
to server. This directs the database manager to skip records in the case of record lock conflicts.AS400JDBCDataSource.CONCURRENTACCESS_NOT_SET
,
AS400JDBCDataSource.CONCURRENTACCESS_USE_CURRENTLY_COMMITTED
,
AS400JDBCDataSource.CONCURRENTACCESS_WAIT_FOR_OUTCOME
, or
AS400JDBCDataSource.CONCURRENTACCESS_SKIP_LOCKS
public abstract int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
cursor hold
driver property. java.sql.SQLException
- If the connection is not open.public abstract java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
- If an error occurs.public abstract JDProperties getProperties() throws java.sql.SQLException
java.sql.SQLException
- If a database error occurs.public abstract java.lang.String getServerJobIdentifier()
Note: Since this method is not defined in the JDBC Connection interface, you typically need to cast a Connection object to AS400JDBCConnection in order to call this method:
String serverJobIdentifier = ((AS400JDBCConnection)connection).getServerJobIdentifier();
public abstract AS400 getSystem()
Note: Since this method is not defined in the JDBC Connection interface, you typically need to cast a Connection object to AS400JDBCConnection in order to call this method:
AS400 system = ((AS400JDBCConnection)connection).getSystem();
public abstract int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open.public abstract java.util.Map getTypeMap() throws java.sql.SQLException
This driver does not support the type map.
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public abstract java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
- If an error occurs.public abstract boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
- If an error occurs.public abstract boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open.public abstract java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
sql
- The SQL statement in terms of the JDBC SQL grammar.java.sql.SQLException
- If the SQL statement has a syntax error.public abstract java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
Result sets created using the statement will be type ResultSet.TYPE_FORWARD_ONLY and concurrency ResultSet.CONCUR_READ_ONLY.
prepareCall
in interface java.sql.Connection
sql
- The SQL stored procedure call.java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, or an
error occurs.public abstract java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
sql
- The SQL statement.resultSetType
- The result set type. Valid values are:
resultSetConcurrency
- The result set concurrency. Valid values are:
java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, the
result type or currency is not valid,
or an error occurs.public abstract java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
Full functionality of this method requires support in OS/400 V5R2 or IBM i. If connecting to OS/400 V5R1 or earlier, the value for resultSetHoldability will be ignored.
prepareCall
in interface java.sql.Connection
sql
- The SQL statement.resultSetType
- The result set type. Valid values are:
resultSetConcurrency
- The result set concurrency. Valid values are:
resultSetHoldability
- The result set holdability. Valid values are:
java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, the
result type, currency, or holdability is not valid,
or an error occurs.public abstract java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
Result sets created using the statement will be type ResultSet.TYPE_FORWARD_ONLY and concurrency ResultSet.CONCUR_READ_ONLY.
prepareStatement
in interface java.sql.Connection
sql
- The SQL statement.java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, or an
error occurs.public abstract java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
This method requires OS/400 V5R2 or IBM i. If connecting to OS/400 V5R1 or earlier, an exception will be thrown.
Result sets created using the statement will be type ResultSet.TYPE_FORWARD_ONLY and concurrency ResultSet.CONCUR_READ_ONLY.
prepareStatement
in interface java.sql.Connection
sql
- The SQL statement.autoGeneratedKeys
- Whether to return auto generated keys. Valid values are:
java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached,
if connecting to OS/400 V5R1 or earlier,
an error occurs.public abstract java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
Result sets created using the statement will be holdability ResultSet.CLOSE_CURSORS_AT_COMMIT.
prepareStatement
in interface java.sql.Connection
sql
- The SQL statement.resultSetType
- The result set type. Valid values are:
resultSetConcurrency
- The result set concurrency. Valid values are:
java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, the
result type or currency is not valid,
or an error occurs.public abstract java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
sql
- The SQL statement.resultSetType
- The result set type. Valid values are:
resultSetConcurrency
- The result set concurrency. Valid values are:
resultSetHoldability
- The result set holdability. Valid values are:
java.sql.SQLException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, the
result type, currency, or holdability is not valid,
or an error occurs.public abstract java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
This method is not supported when connecting to IBM i V5R4 or earlier systems.
prepareStatement
in interface java.sql.Connection
sql
- The SQL statement.columnIndexes
- An array of column indexes indicating the columns that should be returned from the inserted row or rows.java.sql.SQLException
- - If connecting to IBM i V5R4 or earlier systems,
the connection is not open,
the maximum number of statements for this connection has been reached,
or an error occurs.public abstract java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
This method is not supported when connecting to IBM i V5R4 or earlier systems.
prepareStatement
in interface java.sql.Connection
sql
- The SQL statement.columnNames
- An array of column names indicating the columns that should be returned from the inserted row or rows.java.sql.SQLException
- - If connecting to IBM i V5R4 or earlier systems,
the connection is not open,
the maximum number of statements for this connection has been reached,
or an error occurs.public abstract void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
savepoint
- the savepoint to be removed.java.sql.SQLException
- if a database access error occurs or the given Savepoint
is not a valid savepoint in the current transaction.public abstract void rollback() throws java.sql.SQLException
This method can not be called when the connection is part of a distributed transaction. See AS400JDBCXAResource for more information.
rollback
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open
or an error occurs.public abstract void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
savepoint
- the savepoint to be rolled back to.java.sql.SQLException
- if a database access error occurs, the Savepoint
is no longer valid, or this Connection
is currently in auto-commit mode.public abstract void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
By default, the connection is in auto-commit mode. The commit occurs when the statement execution completes or the next statement execute occurs, whichever comes first. In the case of statements returning a result set, the statement execution completes when the last row of the result set has been retrieved or the result set has been closed. In advanced cases, a single statement may return multiple results as well as output parameter values. Here the commit occurs when all results and output parameter values have been retrieved.
The auto-commit mode is always false when the connection is part of a distributed transaction. See AS400JDBCXAResource for more information.
setAutoCommit
in interface java.sql.Connection
autoCommit
- true to turn on auto-commit mode, false to
turn it off.java.sql.SQLException
- If the connection is not open
or an error occurs.public abstract void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open.public abstract void setConcurrentAccessResolution(int concurrentAccessResolution) throws java.sql.SQLException
AS400JDBCDataSource.CONCURRENTACCESS_NOT_SET
,
AS400JDBCDataSource.CONCURRENTACCESS_USE_CURRENTLY_COMMITTED
,
AS400JDBCDataSource.CONCURRENTACCESS_WAIT_FOR_OUTCOME
and
AS400JDBCDataSource.CONCURRENTACCESS_SKIP_LOCKS
,
with the property defaulting to AS400JDBCDataSource.CONCURRENTACCESS_NOT_SET
.
Setting this property to default exhibits the default behavior on the servers
i.e., the semantic applied for read
transactions to avoid locks will be determined by the server.
AS400JDBCDataSource.CONCURRENTACCESS_USE_CURRENTLY_COMMITTED
specifies that driver will flow USE CURRENTLY COMMITTED
to server. Whether CURRENTLY COMMITTED will actually be in effect is
ultimately determined by server.
AS400JDBCDataSource.CONCURRENTACCESS_WAIT_FOR_OUTCOME
specifies that driver will flow WAIT FOR OUTCOME
to server. This will disable the CURRENTLY COMMITTED behavior at the server,
if enabled, and the server will wait for the commit or rollback of data in the process of
being updated.
AS400JDBCDataSource.CONCURRENTACCESS_SKIP_LOCKS
specifies that driver will flow SKIP LOCKS
to server. This directs the database manager to skip records in the case of record lock conflicts.concurrentAccessResolution
- The current access resolution setting. Possible valuse:
AS400JDBCDataSource.CONCURRENTACCESS_NOT_SET
,
AS400JDBCDataSource.CONCURRENTACCESS_USE_CURRENTLY_COMMITTED
,
AS400JDBCDataSource.CONCURRENTACCESS_WAIT_FOR_OUTCOME
, or
AS400JDBCDataSource.CONCURRENTACCESS_SKIP_LOCKS
java.sql.SQLException
- If a database error occurs.public abstract void setDB2eWLMCorrelator(byte[] bytes) throws java.sql.SQLException
bytes
- The eWLM correlator valuejava.sql.SQLException
- If a database error occurs.public abstract void setHoldability(int holdability) throws java.sql.SQLException
Full functionality of this method requires OS/400 V5R2 or IBM i. If connecting to OS/400 V5R1 or earlier, all cursors for the connection will be changed to the value of the variable holdability.
setHoldability
in interface java.sql.Connection
holdability
- The cursor holdability.
Valid values are ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMIT.java.sql.SQLException
- If the connection is not open
or the value passed in is not valid.public abstract void setReadOnly(boolean readOnly) throws java.sql.SQLException
This method can not be called when the connection is part of a distributed transaction. See AS400JDBCXAResource for more information.
setReadOnly
in interface java.sql.Connection
java.sql.SQLException
- If the connection is not open,
a transaction is active, or the
"access" property is set to "read
only".public abstract java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
- if a database access error occurs or this Connection object is currently in auto-commit mode.public abstract java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
name
- A String containing the name of the savepointjava.sql.SQLException
- if a database access error occurs or this Connection object is currently in auto-commit mode.public abstract void setTransactionIsolation(int level) throws java.sql.SQLException
JDBC and DB2 for IBM i use different terminology for transaction isolation levels. The following table provides a terminology mapping:
IBM i isolation level | JDBC transaction isolation level |
---|---|
*CHG | TRANSACTION_READ_UNCOMMITTED |
*CS | TRANSACTION_READ_COMMITTED |
*ALL | TRANSACTION_READ_REPEATABLE_READ |
*RR | TRANSACTION_SERIALIZABLE |
setTransactionIsolation
in interface java.sql.Connection
level
- The transaction isolation level. Possible
values are:
java.sql.SQLException
- If the connection is not open,
the input level is not valid
or unsupported, or a transaction
is active.public abstract void setTypeMap(java.util.Map typeMap) throws java.sql.SQLException
Note: Distinct types are supported by DB2 for IBM i, but are not externalized by the IBM Toolbox for Java JDBC driver. In other words, distinct types behave as if they are the underlying type. Structured types are not supported by DB2 for IBM i. Consequently, this driver does not support the type map.
setTypeMap
in interface java.sql.Connection
typeMap
- The type map.java.sql.SQLException
- This exception is always thrown.public abstract java.lang.String toString()
toString
in class java.lang.Object
public abstract void setClientInfo(java.lang.String name, java.lang.String value) throws java.sql.SQLException
Applications may use the DatabaseMetaData.getClientInfoProperties
method to determine the client info properties supported by the driver
and the maximum length that may be specified for each property.
The driver stores the value specified in a suitable location in the database. For example in a special register, session parameter, or system table column. For efficiency the driver may defer setting the value in the database until the next time a statement is executed or prepared. Other than storing the client information in the appropriate place in the database, these methods shall not alter the behavior of the connection in anyway. The values supplied to these methods are used for accounting, diagnostics and debugging purposes only.
The driver shall generate a warning if the client info name specified is not recognized by the driver.
If the value specified to this method is greater than the maximum
length for the property the driver may either truncate the value and
generate a warning or generate a SQLException
. If the driver
generates a SQLException
, the value specified was not set on the
connection.
The following client info properties are supported in Toobox for Java.
setClientInfo
in interface java.sql.Connection
name
- The name of the client info property to setvalue
- The value to set the client info property to. If the
value is null, the current value of the specified
property is cleared.
//JDBC40DOC * @throws SQLClientInfoException if the database returns an error while //JDBC40DOC * setting the client info value on the database server.
java.sql.SQLException
public abstract void setClientInfo(java.util.Properties properties) throws java.sql.SQLException
Properties
object contains the names and values of the
client info properties to be set. The set of client info properties
contained in the properties list replaces the current set of client info
properties on the connection. If a property that is currently set on the
connection is not present in the properties list, that property is
cleared. Specifying an empty properties list will clear all of the
properties on the connection. See
setClientInfo (String, String)
for more information.
If an error occurs in setting any of the client info properties, a
ClientInfoException
is thrown. The
ClientInfoException
contains information indicating which
client info properties were not set. The state of the client information
is unknown because some databases do not allow multiple client info
properties to be set atomically. For those databases, one or more
properties may have been set before the error occurred.
The following client info properties are supported in Toobox for Java.
setClientInfo
in interface java.sql.Connection
properties
- the list of client info properties to set
//JDBC40DOC * @throws SQLClientInfoException If there is a problem with the Client Info.
//JDBC40DOC * if the database returns an error while setting the
//JDBC40DOC * clientInfo values on the databasejava.sql.SQLException
public abstract java.lang.String getClientInfo(java.lang.String name) throws java.sql.SQLException
Applications may use the DatabaseMetaData.getClientInfoProperties
method to determine the client info properties supported by the driver.
The following client info properties are supported in Toobox for Java.
getClientInfo
in interface java.sql.Connection
name
- The name of the client info property to retrieve
java.sql.SQLException
- if the database returns an error when
fetching the client info value from the database.
see java.sql.DatabaseMetaData#getClientInfoProperties
public abstract java.util.Properties getClientInfo() throws java.sql.SQLException
The following client info properties are supported in Toobox for Java.
getClientInfo
in interface java.sql.Connection
Properties
object that contains the name and current value of
each of the client info properties supported by the driver.
java.sql.SQLException
- if the database returns an error when
fetching the client info values from the databasepublic abstract java.sql.Clob createClob() throws java.sql.SQLException
Clob
interface. The object
returned initially contains no data. The setAsciiStream
,
setCharacterStream
and setString
methods of
the Clob
interface may be used to add data to the Clob
.createClob
in interface java.sql.Connection
Clob
interfacejava.sql.SQLException
- if an object that implements the
Clob
interface can not be constructed.public abstract java.sql.Blob createBlob() throws java.sql.SQLException
Blob
interface. The object
returned initially contains no data. The setBinaryStream
and
setBytes
methods of the Blob
interface may be used to add data to
the Blob
.createBlob
in interface java.sql.Connection
Blob
interfacejava.sql.SQLException
- if an object that implements the
Blob
interface can not be constructedpublic abstract java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements) throws java.sql.SQLException
createArrayOf
in interface java.sql.Connection
typeName
- the SQL name of the type the elements of the array map to. The typeName is a
database-specific name which may be the name of a built-in type, a user-defined type or a standard SQL type supported by this database. This
is the value returned by Array.getBaseTypeName
For Toolbox, the typeName will correspond to a typename in java.sql.Types.elements
- the elements that populate the returned objectjava.sql.SQLException
- if a database error occurs, the typeName is null or this method is called on a closed connectionpublic abstract java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException
createStruct
in interface java.sql.Connection
typeName
- the SQL type name of the SQL structured type that this Struct
object maps to. The typeName is the name of a user-defined type that
has been defined for this database. It is the value returned by
Struct.getSQLTypeName
.attributes
- the attributes that populate the returned objectjava.sql.SQLException
- if a database error occurs, the typeName is null or this method is called on a closed connectionpublic abstract void setDBHostServerTrace(boolean trace)
trace
- true to start database host server tracing, false to end it.public abstract boolean doUpdateDeleteBlocking()
public abstract int getMaximumBlockedInputRows()
public abstract java.lang.String getSchema() throws java.sql.SQLException
Connection
object's current schema name.java.sql.SQLException
- if a database access error occurs or this method is called on a closed connectionpublic abstract void setNetworkTimeout(int timeout) throws java.sql.SQLException
In the JTOpen JDBC driver, this is implemented by setting the SoTimeout of the underlying socket.
Currently, setting the network timeout is only supported when the "thread used" property is false.
When the driver determines that the setNetworkTimeout timeout value has expired, the JDBC driver marks the connection closed and releases any resources held by the connection.
This method checks to see that there is an SQLPermission object before allowing the method to proceed. If a SecurityManager exists and its checkPermission method denies calling setNetworkTimeout, this method throws a java.lang.SecurityException.
timeout
- - The time in milliseconds to wait for the database operation to complete. If the
JDBC driver does not support milliseconds, the JDBC driver will round the value up to the nearest second.
If the timeout period expires before the operation completes, a SQLException will be thrown. A value of
0 indicates that there is not timeout for database operations.java.sql.SQLException
- If a database error occurs.java.sql.SQLException
- - if a database access error occurs, this method is called on a closed connection,
or the value specified for seconds is less than 0.java.lang.SecurityException
- - if a security manager exists and its checkPermission method denies calling
setNetworkTimeout.SecurityManager.checkPermission(java.security.Permission)
,
Statement.setQueryTimeout(int)
,
//JDBC40DOC * @see #abort(java.util.concurrent.Executor)
//JDBC40DOC * @see Executor
public abstract int getNetworkTimeout() throws java.sql.SQLException
java.sql.SQLException
- - if a database access error occurs or this method is called on a closed Connectionpublic abstract void setSchema(java.lang.String schema) throws java.sql.SQLException
Calling setSchema has no effect on previously created or prepared Statement objects. For the toolbox driver, the DBMS prepare operation takes place immediately when the Connection method prepareStatement or prepareCall is invoked. For maximum portability, setSchema should be called before a Statement is created or prepared.
schema
- The name of the schema to use for the connectionjava.sql.SQLException
- If a database access error occurs or this method is
called on a closed connectionpublic abstract void setDisableCompression(boolean disableCompression_)
public abstract void dumpStatementCreationLocation()
public void setInFinalizer(boolean setting)
public abstract java.lang.String[] getReconnectURLs()