AutoCloseable, Connection, Wrapperpublic class AS400JDBCConnectionRedirect extends AS400JDBCConnection
The AS400JDBCConnectionRedirect class provide a level of indirection above AS400JDBCConnections. The goal is to be able to switch to use an alternative server if the existing server becomes unavailable. This class is only used if enableClientAffinitiesList is set to 1.
| Modifier and Type | Field | Description |
|---|---|---|
static int |
SEAMLESS_RETRY_COUNT |
inFinalizer_TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Modifier and Type | Method | Description |
|---|---|---|
void |
abort(Executor executor) |
Terminates an open connection.
|
void |
cancel(int id) |
|
void |
checkAccess(JDSQLStatement sqlStatement) |
|
void |
checkCancel() |
|
boolean |
checkHoldabilityConstants(int holdability) |
|
void |
checkOpen() |
|
void |
clearWarnings() |
Clears all warnings that have been reported for the connection.
|
void |
close() |
Releases the connection's resources immediately instead of waiting
for them to be automatically released.
|
void |
commit() |
Commits all changes made since the previous commit or
rollback and releases any database locks currently held by
the connection.
|
int |
correctResultSetType(int resultSetType,
int resultSetConcurrency) |
|
Array |
createArrayOf(String typeName,
Object[] elements) |
Factory method for creating Array objects.
|
Blob |
createBlob() |
Constructs an object that implements the
Blob interface. |
Clob |
createClob() |
Constructs an object that implements the
Clob interface. |
NClob |
createNClob() |
Constructs an object that implements the
NClob interface. |
SQLXML |
createSQLXML() |
Constructs an object that implements the
SQLXML interface. |
Statement |
createStatement() |
Creates a Statement object for executing SQL statements without
parameters.
|
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
Creates a Statement object for executing SQL statements without
parameters.
|
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Creates a Statement object for executing SQL statements without
parameters.
|
Struct |
createStruct(String typeName,
Object[] attributes) |
Factory method for creating Struct objects.
|
void |
debug(com.ibm.as400.access.DBBaseRequestDS request) |
|
void |
debug(com.ibm.as400.access.DBReplyRequestedDS reply) |
|
boolean |
doUpdateDeleteBlocking() |
|
void |
dumpStatementCreationLocation() |
|
void |
finalize() |
|
com.ibm.as400.access.AS400Impl |
getAS400() |
|
boolean |
getAutoCommit() |
Returns the auto-commit state.
|
String |
getCatalog() |
Returns the catalog name.
|
boolean |
getCheckStatementHoldability() |
|
Properties |
getClientInfo() |
Returns a list containing the name and current value of each client info
property supported by the driver.
|
String |
getClientInfo(String name) |
Returns the value of the client info property specified by name.
|
int |
getConcurrentAccessResolution() |
This method returns the concurrent access resolution setting.
|
ConvTable |
getConverter() |
|
ConvTable |
getConverter(int ccsid) |
|
int |
getDataCompression() |
|
String |
getDefaultSchema() |
|
String |
getDefaultSchema(boolean returnRawValue) |
|
int |
getHoldability() |
Returns the holdability of ResultSets created from this connection.
|
int |
getID() |
|
int |
getInternalHoldability() |
|
String |
getLastServerSQLState() |
|
int |
getMaximumBlockedInputRows() |
|
DatabaseMetaData |
getMetaData() |
Returns the DatabaseMetaData object that describes the
connection's tables, supported SQL grammar, stored procedures,
capabilities and more.
|
boolean |
getMustSpecifyForUpdate() |
|
int |
getNetworkTimeout() |
Retrieves the number of milliseconds the driver will wait for a database request to complete.
|
ConvTable |
getPackageCCSID_Converter() |
|
JDProperties |
getProperties() |
Returns the connection properties.
|
boolean |
getReadOnly() |
|
String[] |
getReconnectURLs() |
Returns a String array containing the URLs that are used when to
reconnect to a system when the "enableClientAffinities" property
is set.
|
String |
getSchema() |
Retrieves this
Connection object's current schema name. |
int |
getServerFunctionalLevel() |
|
String |
getServerJobIdentifier() |
Returns the job identifier of the host server job corresponding to this connection.
|
AS400 |
getSystem() |
Returns the system object which is managing the connection to the system.
|
int |
getTransactionIsolation() |
Returns the transaction isolation level.
|
com.ibm.as400.access.JDTransactionManager |
getTransactionManager() |
|
Map |
getTypeMap() |
Returns the type map.
|
int |
getUnusedId(int resultSetType) |
|
String |
getURL() |
|
String |
getUserName() |
|
String[] |
getValidWrappedList() |
|
int |
getVRM() |
|
SQLWarning |
getWarnings() |
Returns the first warning reported for the connection.
|
void |
handleAbort() |
|
boolean |
ignoreWarning(String sqlState) |
|
boolean |
ignoreWarning(SQLWarning warning) |
|
boolean |
isClosed() |
Indicates if the connection is closed.
|
boolean |
isCursorNameUsed(String cursorName) |
|
boolean |
isQueryTimeoutMechanismCancel() |
|
boolean |
isReadOnly() |
Indicates if the connection is in read-only mode.
|
boolean |
isReadOnlyAccordingToProperties() |
|
boolean |
isValid(int timeout) |
Returns true if the connection has not been closed and is still valid.
|
boolean |
isWrapperFor(Class<?> iface) |
Returns true if this either implements the interface argument or is
directly or indirectly a wrapper for an object that does.
|
String |
makeGeneratedKeySelectStatement(String sql) |
|
String |
makeGeneratedKeySelectStatement(String sql,
int[] columnIndexes,
String[] columnNames) |
|
void |
markCursorsClosed(boolean isRollback) |
|
void |
markStatementsClosed() |
|
String |
nativeSQL(String sql) |
Returns the native form of an SQL statement without
executing it.
|
void |
notifyClose(AS400JDBCStatement statement,
int id) |
|
void |
postWarning(int id,
int errorCode,
int returnCode) |
|
void |
postWarningSQLState(String sqlState) |
|
CallableStatement |
prepareCall(String sql) |
Precompiles an SQL stored procedure call with optional input
and output parameters and stores it in a CallableStatement
object.
|
CallableStatement |
prepareCall(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.
|
CallableStatement |
prepareCall(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.
|
PreparedStatement |
prepareStatement(String sql) |
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys) |
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes) |
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) |
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
PreparedStatement |
prepareStatement(String sql,
String[] columnNames) |
Precompiles an SQL statement with optional input parameters
and stores it in a PreparedStatement object.
|
void |
processSavepointRequest(String savepointStatement) |
|
void |
pseudoClose() |
|
com.ibm.as400.access.DBReplyRequestedDS |
receiveMoreData() |
|
void |
releaseSavepoint(Savepoint savepoint) |
Removes the given Savepoint object from the current transaction.
|
void |
rollback() |
Drops all changes made since the previous commit or
rollback and releases any database locks currently held by
the connection.
|
void |
rollback(Savepoint savepoint) |
Undoes all changes made after the specified Savepoint was set.
|
void |
send(com.ibm.as400.access.DBBaseRequestDS request) |
|
void |
send(com.ibm.as400.access.DBBaseRequestDS request,
int id) |
|
void |
send(com.ibm.as400.access.DBBaseRequestDS request,
int id,
boolean leavePending) |
|
void |
sendAndHold(com.ibm.as400.access.DBBaseRequestDS request,
int id) |
|
com.ibm.as400.access.DBReplyRequestedDS |
sendAndMultiReceive(com.ibm.as400.access.DBBaseRequestDS request) |
|
com.ibm.as400.access.DBReplyRequestedDS |
sendAndReceive(com.ibm.as400.access.DBBaseRequestDS request) |
|
com.ibm.as400.access.DBReplyRequestedDS |
sendAndReceive(com.ibm.as400.access.DBBaseRequestDS request,
int id) |
|
void |
setAutoCommit(boolean autoCommit) |
Sets the auto-commit mode.
|
void |
setCatalog(String catalog) |
This method is not supported.
|
void |
setCheckStatementHoldability(boolean check) |
|
void |
setClientInfo(String name,
String value) |
Sets the value of the client info property specified by name to the
value specified by value.
|
void |
setClientInfo(Properties properties) |
Sets the value of the connection's client info properties.
|
void |
setConcurrentAccessResolution(int concurrentAccessResolution) |
This method sets concurrent access resolution.
|
void |
setDB2eWLMCorrelator(byte[] bytes) |
Sets the eWLM Correlator.
|
void |
setDBHostServerTrace(boolean trace) |
Starts or stops the Database Host Server trace for this connection.
|
void |
setDisableCompression(boolean disableCompression_) |
|
void |
setDRDA(boolean drda) |
|
void |
setHoldability(int holdability) |
Sets the holdability of ResultSets created from this connection.
|
void |
setLastServerSQLState(String lastSqlState) |
|
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.
|
void |
setNetworkTimeout(Executor executor,
int milliseconds) |
Sets the maximum period a Connection or objects created from the Connection will wait for the database to
reply to any one request.
|
void |
setProperties(JDDataSourceURL dataSourceUrl,
JDProperties properties,
AS400 as400) |
|
void |
setProperties(JDDataSourceURL dataSourceUrl,
JDProperties properties,
com.ibm.as400.access.AS400Impl as400) |
|
void |
setProperties(JDDataSourceURL dataSourceUrl,
JDProperties properties,
com.ibm.as400.access.AS400Impl as400,
boolean newServer,
boolean skipSignonServer) |
|
void |
setReadOnly(boolean readOnly) |
Sets the read-only mode.
|
Savepoint |
setSavepoint() |
Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.
|
Savepoint |
setSavepoint(String name) |
Creates a named savepoint in the current transaction and returns the new Savepoint object that represents it.
|
Savepoint |
setSavepoint(String name,
int id) |
|
void |
setSchema(String schema) |
Sets the given schema name to access.
|
void |
setServerAttributes() |
|
void |
setSystem(AS400 as400) |
|
void |
setTransactionIsolation(int level) |
Sets the transaction isolation level.
|
void |
setTypeMap(Map typeMap) |
Sets the type map to be used for distinct and structured
types.
|
void |
setupVariableFieldCompression() |
|
boolean |
testDataTruncation(AS400JDBCStatement statementWarningObject,
AS400JDBCResultSet resultSetWarningObject,
int parameterIndex,
boolean isParameter,
com.ibm.as400.access.SQLData data,
JDSQLStatement sqlStatement) |
|
String |
toString() |
Returns the connection's catalog name.
|
<T> T |
unwrap(Class<T> iface) |
Returns an object that implements the given interface to allow access to
non-standard methods, or standard methods not exposed by the proxy.
|
boolean |
useExtendedFormats() |
|
boolean |
useVariableFieldCompression() |
|
boolean |
useVariableFieldInsertCompression() |
setInFinalizerclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitbeginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValidisWrapperFor, unwrappublic static final int SEAMLESS_RETRY_COUNT
public void cancel(int id)
throws SQLException
SQLExceptionpublic void checkAccess(JDSQLStatement sqlStatement) throws SQLException
SQLExceptionpublic void checkCancel()
public boolean checkHoldabilityConstants(int holdability)
public void checkOpen()
throws SQLException
SQLExceptionpublic void clearWarnings()
throws SQLException
AS400JDBCConnectionclearWarnings in interface ConnectionclearWarnings in class AS400JDBCConnectionSQLException - If an error occurs.public void close()
throws SQLException
AS400JDBCConnectionclose in interface AutoCloseableclose in interface Connectionclose in class AS400JDBCConnectionSQLException - If an error occurs.public void handleAbort()
public void commit()
throws SQLException
AS400JDBCConnectionThis method can not be called when the connection is part of a distributed transaction. See AS400JDBCXAResource for more information.
commit in interface Connectioncommit in class AS400JDBCConnectionSQLException - If the connection is not open
or an error occurs.public void setCheckStatementHoldability(boolean check)
public int correctResultSetType(int resultSetType,
int resultSetConcurrency)
throws SQLException
SQLExceptionpublic Statement createStatement() throws SQLException
AS400JDBCConnectionResult sets created using the statement will be type ResultSet.TYPE_FORWARD_ONLY and concurrency ResultSet.CONCUR_READ_ONLY.
createStatement in interface ConnectioncreateStatement in class AS400JDBCConnectionSQLException - If the connection is not open,
the maximum number of statements
for this connection has been reached, or an
error occurs.public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
AS400JDBCConnectioncreateStatement in interface ConnectioncreateStatement in class AS400JDBCConnectionresultSetType - The result set type. Valid values are:
resultSetConcurrency - The result set concurrency. Valid values are:
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 Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
AS400JDBCConnectionFull 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 ConnectioncreateStatement in class AS400JDBCConnectionresultSetType - The result set type. Valid values are:
resultSetConcurrency - The result set concurrency. Valid values are:
resultSetHoldability - The result set holdability. Valid values are:
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 void debug(com.ibm.as400.access.DBBaseRequestDS request)
public void debug(com.ibm.as400.access.DBReplyRequestedDS reply)
public com.ibm.as400.access.AS400Impl getAS400()
throws SQLException
SQLExceptionpublic boolean getAutoCommit()
throws SQLException
AS400JDBCConnectiongetAutoCommit in interface ConnectiongetAutoCommit in class AS400JDBCConnectionSQLException - If the connection is not open.public String getCatalog() throws SQLException
AS400JDBCConnectiongetCatalog in interface ConnectiongetCatalog in class AS400JDBCConnectionSQLException - If the connection is not open.public int getConcurrentAccessResolution()
AS400JDBCConnectionAS400JDBCDataSource.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.getConcurrentAccessResolution in class AS400JDBCConnectionAS400JDBCDataSource.CONCURRENTACCESS_NOT_SET,
AS400JDBCDataSource.CONCURRENTACCESS_USE_CURRENTLY_COMMITTED,
AS400JDBCDataSource.CONCURRENTACCESS_WAIT_FOR_OUTCOME, or
AS400JDBCDataSource.CONCURRENTACCESS_SKIP_LOCKSpublic ConvTable getConverter(int ccsid) throws SQLException
SQLExceptionpublic int getDataCompression()
public String getDefaultSchema() throws SQLException
SQLExceptionpublic String getDefaultSchema(boolean returnRawValue) throws SQLException
SQLExceptionpublic int getHoldability()
throws SQLException
AS400JDBCConnectiongetHoldability in interface ConnectiongetHoldability in class AS400JDBCConnection cursor hold
driver property. SQLException - If the connection is not open.public int getID()
public int getInternalHoldability()
public DatabaseMetaData getMetaData() throws SQLException
AS400JDBCConnectiongetMetaData in interface ConnectiongetMetaData in class AS400JDBCConnectionSQLException - If an error occurs.public JDProperties getProperties() throws SQLException
AS400JDBCConnectiongetProperties in class AS400JDBCConnectionSQLException - If a database error occurs.public String getServerJobIdentifier()
AS400JDBCConnectionNote: 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();
getServerJobIdentifier in class AS400JDBCConnectionpublic int getServerFunctionalLevel()
public AS400 getSystem()
AS400JDBCConnectionNote: 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();
getSystem in class AS400JDBCConnectionpublic int getTransactionIsolation()
throws SQLException
AS400JDBCConnectiongetTransactionIsolation in interface ConnectiongetTransactionIsolation in class AS400JDBCConnectionSQLException - If the connection is not open.public com.ibm.as400.access.JDTransactionManager getTransactionManager()
public Map getTypeMap() throws SQLException
AS400JDBCConnectionThis driver does not support the type map.
getTypeMap in interface ConnectiongetTypeMap in class AS400JDBCConnectionSQLException - This exception is always thrown.public int getUnusedId(int resultSetType)
throws SQLException
SQLExceptionpublic boolean getMustSpecifyForUpdate()
public String getURL() throws SQLException
SQLExceptionpublic String getUserName() throws SQLException
SQLExceptionpublic int getVRM()
throws SQLException
SQLExceptionpublic SQLWarning getWarnings() throws SQLException
AS400JDBCConnectiongetWarnings in interface ConnectiongetWarnings in class AS400JDBCConnectionSQLException - If an error occurs.public boolean isCursorNameUsed(String cursorName) throws SQLException
SQLExceptionpublic boolean isClosed()
throws SQLException
AS400JDBCConnectionisClosed in interface ConnectionisClosed in class AS400JDBCConnectionSQLException - If an error occurs.public boolean isReadOnly()
throws SQLException
AS400JDBCConnectionisReadOnly in interface ConnectionisReadOnly in class AS400JDBCConnectionSQLException - If the connection is not open.public boolean isReadOnlyAccordingToProperties()
throws SQLException
SQLExceptionpublic void markCursorsClosed(boolean isRollback)
throws SQLException
SQLExceptionpublic void markStatementsClosed()
public String makeGeneratedKeySelectStatement(String sql, int[] columnIndexes, String[] columnNames) throws SQLException
SQLExceptionpublic String makeGeneratedKeySelectStatement(String sql) throws SQLException
SQLExceptionpublic String nativeSQL(String sql) throws SQLException
AS400JDBCConnectionnativeSQL in interface ConnectionnativeSQL in class AS400JDBCConnectionsql - The SQL statement in terms of the JDBC SQL grammar.SQLException - If the SQL statement has a syntax error.public void notifyClose(AS400JDBCStatement statement, int id) throws SQLException
SQLExceptionpublic void postWarningSQLState(String sqlState) throws SQLException
SQLExceptionpublic void postWarning(int id,
int errorCode,
int returnCode)
throws SQLException
SQLExceptionpublic CallableStatement prepareCall(String sql) throws SQLException
AS400JDBCConnectionResult sets created using the statement will be type ResultSet.TYPE_FORWARD_ONLY and concurrency ResultSet.CONCUR_READ_ONLY.
prepareCall in interface ConnectionprepareCall in class AS400JDBCConnectionsql - The SQL stored procedure call.SQLException - If the connection is not open,
the maximum number of statements
for this connection has been reached, or an
error occurs.public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
AS400JDBCConnectionprepareCall in interface ConnectionprepareCall in class AS400JDBCConnectionsql - The SQL statement.resultSetType - The result set type. Valid values are:
resultSetConcurrency - The result set concurrency. Valid values are:
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 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
AS400JDBCConnectionFull 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 ConnectionprepareCall in class AS400JDBCConnectionsql - 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:
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 PreparedStatement prepareStatement(String sql) throws SQLException
AS400JDBCConnectionResult sets created using the statement will be type ResultSet.TYPE_FORWARD_ONLY and concurrency ResultSet.CONCUR_READ_ONLY.
prepareStatement in interface ConnectionprepareStatement in class AS400JDBCConnectionsql - The SQL statement.SQLException - If the connection is not open,
the maximum number of statements
for this connection has been reached, or an
error occurs.public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
AS400JDBCConnectionThis 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 ConnectionprepareStatement in class AS400JDBCConnectionsql - The SQL statement.autoGeneratedKeys - Whether to return auto generated keys. Valid values are:
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 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
AS400JDBCConnectionResult sets created using the statement will be holdability ResultSet.CLOSE_CURSORS_AT_COMMIT.
prepareStatement in interface ConnectionprepareStatement in class AS400JDBCConnectionsql - The SQL statement.resultSetType - The result set type. Valid values are:
resultSetConcurrency - The result set concurrency. Valid values are:
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 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
AS400JDBCConnectionprepareStatement in interface ConnectionprepareStatement in class AS400JDBCConnectionsql - 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:
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 PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
AS400JDBCConnectionThis method is not supported when connecting to IBM i V5R4 or earlier systems.
prepareStatement in interface ConnectionprepareStatement in class AS400JDBCConnectionsql - The SQL statement.columnIndexes - An array of column indexes indicating the columns that should be returned from the inserted row or rows.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 PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
AS400JDBCConnectionThis method is not supported when connecting to IBM i V5R4 or earlier systems.
prepareStatement in interface ConnectionprepareStatement in class AS400JDBCConnectionsql - The SQL statement.columnNames - An array of column names indicating the columns that should be returned from the inserted row or rows.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 void processSavepointRequest(String savepointStatement) throws SQLException
SQLExceptionpublic void pseudoClose()
throws SQLException
SQLExceptionpublic void releaseSavepoint(Savepoint savepoint) throws SQLException
AS400JDBCConnectionreleaseSavepoint in interface ConnectionreleaseSavepoint in class AS400JDBCConnectionsavepoint - the savepoint to be removed.SQLException - if a database access error occurs or the given Savepoint
is not a valid savepoint in the current transaction.public void rollback()
throws SQLException
AS400JDBCConnectionThis method can not be called when the connection is part of a distributed transaction. See AS400JDBCXAResource for more information.
rollback in interface Connectionrollback in class AS400JDBCConnectionSQLException - If the connection is not open
or an error occurs.public void rollback(Savepoint savepoint) throws SQLException
AS400JDBCConnectionrollback in interface Connectionrollback in class AS400JDBCConnectionsavepoint - the savepoint to be rolled back to.SQLException - if a database access error occurs, the Savepoint
is no longer valid, or this Connection
is currently in auto-commit mode.public void send(com.ibm.as400.access.DBBaseRequestDS request)
throws SQLException
SQLExceptionpublic void send(com.ibm.as400.access.DBBaseRequestDS request,
int id)
throws SQLException
SQLExceptionpublic void send(com.ibm.as400.access.DBBaseRequestDS request,
int id,
boolean leavePending)
throws SQLException
SQLExceptionpublic void sendAndHold(com.ibm.as400.access.DBBaseRequestDS request,
int id)
throws SQLException
SQLExceptionpublic com.ibm.as400.access.DBReplyRequestedDS sendAndReceive(com.ibm.as400.access.DBBaseRequestDS request)
throws SQLException
SQLExceptionpublic com.ibm.as400.access.DBReplyRequestedDS sendAndReceive(com.ibm.as400.access.DBBaseRequestDS request,
int id)
throws SQLException
SQLExceptionpublic com.ibm.as400.access.DBReplyRequestedDS sendAndMultiReceive(com.ibm.as400.access.DBBaseRequestDS request)
throws SQLException
SQLExceptionpublic com.ibm.as400.access.DBReplyRequestedDS receiveMoreData()
throws SQLException
SQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws SQLException
AS400JDBCConnectionBy 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 ConnectionsetAutoCommit in class AS400JDBCConnectionautoCommit - true to turn on auto-commit mode, false to
turn it off.SQLException - If the connection is not open
or an error occurs.public void setCatalog(String catalog) throws SQLException
AS400JDBCConnectionsetCatalog in interface ConnectionsetCatalog in class AS400JDBCConnectionSQLException - If the connection is not open.public void setConcurrentAccessResolution(int concurrentAccessResolution)
throws SQLException
AS400JDBCConnectionAS400JDBCDataSource.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.setConcurrentAccessResolution in class AS400JDBCConnectionconcurrentAccessResolution - 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_LOCKSSQLException - If a database error occurs.public void setDB2eWLMCorrelator(byte[] bytes)
throws SQLException
AS400JDBCConnectionsetDB2eWLMCorrelator in class AS400JDBCConnectionbytes - The eWLM correlator valueSQLException - If a database error occurs.public void setDRDA(boolean drda)
throws SQLException
SQLExceptionpublic void setHoldability(int holdability)
throws SQLException
AS400JDBCConnectionFull 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 ConnectionsetHoldability in class AS400JDBCConnectionholdability - The cursor holdability.
Valid values are ResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMIT.SQLException - If the connection is not open
or the value passed in is not valid.public void setProperties(JDDataSourceURL dataSourceUrl, JDProperties properties, AS400 as400) throws SQLException
SQLExceptionpublic void setProperties(JDDataSourceURL dataSourceUrl, JDProperties properties, com.ibm.as400.access.AS400Impl as400) throws SQLException
SQLExceptionpublic boolean ignoreWarning(String sqlState)
public boolean ignoreWarning(SQLWarning warning)
public void setProperties(JDDataSourceURL dataSourceUrl, JDProperties properties, com.ibm.as400.access.AS400Impl as400, boolean newServer, boolean skipSignonServer) throws SQLException
SQLExceptionpublic void setReadOnly(boolean readOnly)
throws SQLException
AS400JDBCConnectionThis method can not be called when the connection is part of a distributed transaction. See AS400JDBCXAResource for more information.
setReadOnly in interface ConnectionsetReadOnly in class AS400JDBCConnectionSQLException - If the connection is not open,
a transaction is active, or the
"access" property is set to "read
only".public Savepoint setSavepoint() throws SQLException
AS400JDBCConnectionsetSavepoint in interface ConnectionsetSavepoint in class AS400JDBCConnectionSQLException - if a database access error occurs or this Connection object is currently in auto-commit mode.public Savepoint setSavepoint(String name) throws SQLException
AS400JDBCConnectionsetSavepoint in interface ConnectionsetSavepoint in class AS400JDBCConnectionname - A String containing the name of the savepointSQLException - if a database access error occurs or this Connection object is currently in auto-commit mode.public Savepoint setSavepoint(String name, int id) throws SQLException
SQLExceptionpublic void setServerAttributes()
throws SQLException
SQLExceptionpublic void setSystem(AS400 as400) throws SQLException
SQLExceptionpublic void setTransactionIsolation(int level)
throws SQLException
AS400JDBCConnectionJDBC 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 ConnectionsetTransactionIsolation in class AS400JDBCConnectionlevel - The transaction isolation level. Possible
values are:
SQLException - If the connection is not open,
the input level is not valid
or unsupported, or a transaction
is active.public void setTypeMap(Map typeMap) throws SQLException
AS400JDBCConnectionNote: 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 ConnectionsetTypeMap in class AS400JDBCConnectiontypeMap - The type map.SQLException - This exception is always thrown.public boolean useExtendedFormats()
throws SQLException
SQLExceptionpublic String[] getValidWrappedList()
public void setClientInfo(String name, String value) throws SQLClientInfoException
AS400JDBCConnection
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 ConnectionsetClientInfo in class AS400JDBCConnectionname - 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.
SQLClientInfoException - if the database returns an error while
setting the client info value on the database server.public void setClientInfo(Properties properties) throws SQLClientInfoException
AS400JDBCConnectionProperties 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 ConnectionsetClientInfo in class AS400JDBCConnectionproperties - the list of client info properties to setSQLClientInfoException - If there is a problem with the Client Info.
if the database returns an error while setting the
clientInfo values on the databasepublic String getClientInfo(String name) throws SQLException
AS400JDBCConnection
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 ConnectiongetClientInfo in class AS400JDBCConnectionname - The name of the client info property to retrieve
SQLException - if the database returns an error when
fetching the client info value from the database.
see java.sql.DatabaseMetaData#getClientInfoProperties
public Properties getClientInfo() throws SQLException
AS400JDBCConnectionThe following client info properties are supported in Toobox for Java.
getClientInfo in interface ConnectiongetClientInfo in class AS400JDBCConnectionProperties object that contains the name and current value of
each of the client info properties supported by the driver.
SQLException - if the database returns an error when
fetching the client info values from the databasepublic Clob createClob() throws SQLException
AS400JDBCConnectionClob 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 ConnectioncreateClob in class AS400JDBCConnectionClob interfaceSQLException - if an object that implements the
Clob interface can not be constructed.public Blob createBlob() throws SQLException
AS400JDBCConnectionBlob 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 ConnectioncreateBlob in class AS400JDBCConnectionBlob interfaceSQLException - if an object that implements the
Blob interface can not be constructedpublic Array createArrayOf(String typeName, Object[] elements) throws SQLException
AS400JDBCConnectioncreateArrayOf in interface ConnectioncreateArrayOf in class AS400JDBCConnectiontypeName - 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 objectSQLException - if a database error occurs, the typeName is null or this method is called on a closed connectionpublic Struct createStruct(String typeName, Object[] attributes) throws SQLException
AS400JDBCConnectioncreateStruct in interface ConnectioncreateStruct in class AS400JDBCConnectiontypeName - 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 objectSQLException - if a database error occurs, the typeName is null or this method is called on a closed connectionpublic void setDBHostServerTrace(boolean trace)
AS400JDBCConnectionsetDBHostServerTrace in class AS400JDBCConnectiontrace - true to start database host server tracing, false to end it.public boolean doUpdateDeleteBlocking()
doUpdateDeleteBlocking in class AS400JDBCConnectionpublic int getMaximumBlockedInputRows()
getMaximumBlockedInputRows in class AS400JDBCConnectionpublic String getSchema() throws SQLException
AS400JDBCConnectionConnection object's current schema name.getSchema in interface ConnectiongetSchema in class AS400JDBCConnectionSQLException - if a database access error occurs or this method is called on a closed connectionpublic void setNetworkTimeout(int timeout)
throws SQLException
AS400JDBCConnectionIn 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.
setNetworkTimeout in class AS400JDBCConnectiontimeout - - 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.SQLException - If a database error occurs.SecurityManager.checkPermission(java.security.Permission),
Statement.setQueryTimeout(int),
AS400JDBCConnection.getNetworkTimeout(),
AS400JDBCConnection.abort(java.util.concurrent.Executor),
Executorpublic int getNetworkTimeout()
throws SQLException
AS400JDBCConnectiongetNetworkTimeout in interface ConnectiongetNetworkTimeout in class AS400JDBCConnectionSQLException - - if a database access error occurs or this method is called on a closed ConnectionAS400JDBCConnection.setNetworkTimeout(java.util.concurrent.Executor, int)public void setSchema(String schema) throws SQLException
AS400JDBCConnectionCalling 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.
setSchema in interface ConnectionsetSchema in class AS400JDBCConnectionschema - The name of the schema to use for the connectionSQLException - If a database access error occurs or this method is
called on a closed connectionpublic boolean isQueryTimeoutMechanismCancel()
public void setupVariableFieldCompression()
public boolean useVariableFieldCompression()
public boolean useVariableFieldInsertCompression()
public void setDisableCompression(boolean disableCompression_)
setDisableCompression in class AS400JDBCConnectionpublic void dumpStatementCreationLocation()
dumpStatementCreationLocation in class AS400JDBCConnectionpublic boolean testDataTruncation(AS400JDBCStatement statementWarningObject, AS400JDBCResultSet resultSetWarningObject, int parameterIndex, boolean isParameter, com.ibm.as400.access.SQLData data, JDSQLStatement sqlStatement) throws SQLException
SQLExceptionpublic ConvTable getConverter()
public void setLastServerSQLState(String lastSqlState)
public String getLastServerSQLState()
public ConvTable getPackageCCSID_Converter()
public boolean getReadOnly()
public boolean getCheckStatementHoldability()
public String toString()
AS400JDBCConnectiontoString in class AS400JDBCConnectionpublic String[] getReconnectURLs()
AS400JDBCConnectiongetReconnectURLs in class AS400JDBCConnectionpublic boolean isValid(int timeout)
throws SQLException
AS400JDBCConnectionThe query submitted by the driver to validate the connection shall be executed in the context of the current transaction.
isValid in interface ConnectionisValid in class AS400JDBCConnectiontimeout - - The time in seconds to wait for the database operation
used to validate the connection to complete. If
the timeout period expires before the operation
completes, this method returns false. A value of
0 indicates a timeout is not applied to the
database operation.
SQLException - if a database access error occurs.public NClob createNClob() throws SQLException
AS400JDBCConnectionNClob interface. The object
returned initially contains no data. The setAsciiStream,
setCharacterStream and setString methods of the NClob interface may
be used to add data to the NClob.createNClob in interface ConnectioncreateNClob in class AS400JDBCConnectionNClob interfaceSQLException - if an object that implements the
NClob interface can not be constructed.public SQLXML createSQLXML() throws SQLException
AS400JDBCConnectionSQLXML interface. The object
returned initially contains no data. The createXMLStreamWriter object and
setString method of the SQLXML interface may be used to add data to the SQLXML
object.createSQLXML in interface ConnectioncreateSQLXML in class AS400JDBCConnectionSQLXML interfaceSQLException - if an object that implements the SQLXML interface can not
be constructedpublic void abort(Executor executor) throws SQLException
AS400JDBCConnectionCalling abort marks the connection closed and releases any resources. Calling abort on a closed connection is a no-op.
It is possible that the aborting and releasing of the resources that are held by the connection can take an extended period of time. When the abort method returns, the connection will have been marked as closed and the Executor that was passed as a parameter to abort may still be executing tasks to release resources.
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 abort, this method throws a java.lang.SecurityException.
abort in interface Connectionabort in class AS400JDBCConnectionexecutor - The Executor implementation which will be used by abort.SQLException - - if a database access error occurs or the executor is nullpublic void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
AS400JDBCConnectionIn 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.
Note: This method is intended to address a rare but serious condition where network partitions can cause threads issuing JDBC calls to hang uninterruptedly in socket reads, until the OS TCP-TIMEOUT (typically 10 minutes). This method is related to the abort() method which provides an administrator thread a means to free any such threads in cases where the JDBC connection is accessible to the administrator thread. The setNetworkTimeout method will cover cases where there is no administrator thread, or it has no access to the connection. This method is severe in it's effects, and should be given a high enough value so it is never triggered before any more normal timeouts, such as transaction timeouts.
JDBC driver implementations may also choose to support the setNetworkTimeout method to impose a limit on database response time, in environments where no network is present.
Drivers may internally implement some or all of their API calls with multiple internal driver-database transmissions, and it is left to the driver implementation to determine whether the limit will be applied always to the response to the API call, or to any single request made during the API call.
This method can be invoked more than once, such as to set a limit for an area of JDBC code, and to reset to the default on exit from this area. Invocation of this method has no impact on already outstanding requests.
The Statement.setQueryTimeout() timeout value is independent of the timeout value specified in setNetworkTimeout. If the query timeout expires before the network timeout then the statement execution will be canceled. If the network is still active the result will be that both the statement and connection are still usable. However if the network timeout expires before the query timeout or if the statement timeout fails due to network problems, the connection will be marked as closed, any resources held by the connection will be released and both the connection and statement will be unusable.
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.
setNetworkTimeout in interface ConnectionsetNetworkTimeout in class AS400JDBCConnectionexecutor - - The Executor implementation which will be used by setNetworkTimeout.milliseconds - - 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.SQLException - - if a database access error occurs, this method is called on a closed connection,
the executor is null, or the value specified for seconds is less than 0.SecurityManager.checkPermission(java.security.Permission),
Statement.setQueryTimeout(int),
AS400JDBCConnection.getNetworkTimeout(),
AS400JDBCConnection.abort(java.util.concurrent.Executor),
Executorpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor on the wrapped object. If this does not
implement the interface and is not a wrapper, return false. This method
should be implemented as a low-cost operation compared to
unwrap so that callers can use this method to avoid
expensive unwrap calls that may fail. If this method
returns true then calling unwrap with the same argument
should succeed.isWrapperFor in interface Wrapperiface - a Class defining an interface.SQLException - If a database error occurs.
if an error occurs while determining whether this is a
wrapper for an object with the given interface.public <T> T unwrap(Class<T> iface) throws SQLException
unwrap recursively on the wrapped object or a
proxy for that result. If the receiver is not a wrapper and does not
implement the interface, then an SQLException is thrown.unwrap in interface Wrapperiface - A Class defining an interface that the result must implement.SQLException - If a database error occurs.
If no object found that implements the interfaceCopyright © 2024. All rights reserved.