|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.micro.JdbcMeConnection
The JdbcMeConnection class provides a JDBC connection to a specific DB2 for OS/400 database. Use DriverManager.getConnection() to create new JdbcMeConnection objects.
There are many optional properties that can be specified when the connection is created. Properties can be specified either as part of the URL or in a java.util.Properties object. See JDBC properties for a complete list of properties supported by the JdbcMeDriver.
Note: Since Java 2 Micro-Edition does not include java.sql, JdbcMeConnection implements the java.sql package that is also part of this driver.
Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
Method Summary | |
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. |
java.sql.Statement |
createStatement()
Creates a Statement object for executing SQL statements without parameters. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Create a Statement object that can be used to directly execute SQL. |
boolean |
getAutoCommit()
Returns the auto-commit state. |
int |
getTransactionIsolation()
Returns the transaction isolation level. |
boolean |
isClosed()
Indicates if the connection is closed. |
void |
rollback()
Drops all changes made since the previous commit or rollback and releases any database locks currently held by the connection. |
void |
setAutoCommit(boolean autoCommit)
Sets the auto-commit mode. |
void |
setTransactionIsolation(int isolation)
Sets the transaction isolation level. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.Connection |
clearWarnings, getCatalog, getMetaData, getTypeMap, getWarnings, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareStatement, prepareStatement, setCatalog, setReadOnly, setTypeMap |
Method Detail |
public void close() throws JdbcMeException
close
in interface java.sql.Connection
JdbcMeException
- If an error occurs.public java.sql.Statement createStatement() throws JdbcMeException
createStatement
in interface java.sql.Connection
JdbcMeException
- If the connection is not open,
the maximum number of statements
for this connection has been reached, or an
error occurs.public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws JdbcMeException
createStatement
in interface java.sql.Connection
resultSetType
- The result set type. Valid values are:
resultSetConcurrency
- The result set concurrency. Valid values are:
JdbcMeException
- 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 boolean isClosed() throws JdbcMeException
isClosed
in interface java.sql.Connection
JdbcMeException
- If an error occurs.public void setAutoCommit(boolean autoCommit) throws JdbcMeException
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.
setAutoCommit
in interface java.sql.Connection
autoCommit
- true to turn on auto-commit mode, false to turn it off.JdbcMeException
- If the connection is not open or an error occurs.public boolean getAutoCommit() throws JdbcMeException
getAutoCommit
in interface java.sql.Connection
JdbcMeException
- If an error occurs.public void commit() throws JdbcMeException
commit
in interface java.sql.Connection
public void rollback() throws JdbcMeException
rollback
in interface java.sql.Connection
JdbcMeException
- If the connection is not open or an error occurs.public int getTransactionIsolation() throws JdbcMeException
getTransactionIsolation
in interface java.sql.Connection
JdbcMeException
- If an error occurs.public void setTransactionIsolation(int isolation) throws JdbcMeException
JDBC and DB2/400 use different terminology for transaction isolation levels. The following table provides a terminology mapping:
AS/400 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:
JdbcMeException
- If the connection is not open, the input level is not valid or
unsupported, or a transaction is active.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |