|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.as400.micro.JdbcMeConnection
public class JdbcMeConnection
The JdbcMeConnection class provides a JDBC connection to a specific DB2 for IBM i 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.
| Field Summary |
|---|
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Method Summary | |
|---|---|
void |
clearWarnings()
|
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. |
Statement |
createStatement()
Creates a Statement object for executing SQL statements without parameters. |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Create a Statement object that can be used to directly execute SQL. |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
boolean |
getAutoCommit()
Returns the auto-commit state. |
String |
getCatalog()
|
int |
getHoldability()
|
DatabaseMetaData |
getMetaData()
|
int |
getTransactionIsolation()
Returns the transaction isolation level. |
Map |
getTypeMap()
|
SQLWarning |
getWarnings()
|
boolean |
isClosed()
Indicates if the connection is closed. |
boolean |
isReadOnly()
|
String |
nativeSQL(String sql)
|
CallableStatement |
prepareCall(String sql)
|
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
|
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
PreparedStatement |
prepareStatement(String sql)
|
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys)
|
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes)
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
|
PreparedStatement |
prepareStatement(String sql,
String[] columnNames)
|
void |
releaseSavepoint(Savepoint savepoint)
|
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)
|
void |
setAutoCommit(boolean autoCommit)
Sets the auto-commit mode. |
void |
setCatalog(String catalog)
|
void |
setHoldability(int holdability)
|
void |
setReadOnly(boolean readOnly)
|
Savepoint |
setSavepoint()
|
Savepoint |
setSavepoint(String name)
|
void |
setTransactionIsolation(int isolation)
Sets the transaction isolation level. |
void |
setTypeMap(Map map)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void close()
throws JdbcMeException
close in interface ConnectionJdbcMeException - If an error occurs.
public Statement createStatement()
throws JdbcMeException
createStatement in interface ConnectionJdbcMeException - 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 JdbcMeException
createStatement in interface ConnectionresultSetType - 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 ConnectionJdbcMeException - 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 ConnectionautoCommit - 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 ConnectionJdbcMeException - If an error occurs.
public void commit()
throws JdbcMeException
commit in interface ConnectionJdbcMeException
public void rollback()
throws JdbcMeException
rollback in interface ConnectionJdbcMeException - If the connection is not open or an error occurs.
public int getTransactionIsolation()
throws JdbcMeException
getTransactionIsolation in interface ConnectionJdbcMeException - 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 Connectionisolation - 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.
public void clearWarnings()
throws SQLException
clearWarnings in interface ConnectionSQLException
public Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
createStatement in interface ConnectionSQLException
public String getCatalog()
throws SQLException
getCatalog in interface ConnectionSQLException
public int getHoldability()
throws SQLException
getHoldability in interface ConnectionSQLException
public DatabaseMetaData getMetaData()
throws SQLException
getMetaData in interface ConnectionSQLException
public SQLWarning getWarnings()
throws SQLException
getWarnings in interface ConnectionSQLException
public boolean isReadOnly()
throws SQLException
isReadOnly in interface ConnectionSQLException
public String nativeSQL(String sql)
throws SQLException
nativeSQL in interface ConnectionSQLException
public CallableStatement prepareCall(String sql)
throws SQLException
prepareCall in interface ConnectionSQLException
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
prepareCall in interface ConnectionSQLException
public CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
prepareCall in interface ConnectionSQLException
public PreparedStatement prepareStatement(String sql)
throws SQLException
prepareStatement in interface ConnectionSQLException
public PreparedStatement prepareStatement(String sql,
int autoGeneratedKeys)
throws SQLException
prepareStatement in interface ConnectionSQLException
public PreparedStatement prepareStatement(String sql,
int[] columnIndexes)
throws SQLException
prepareStatement in interface ConnectionSQLException
public PreparedStatement prepareStatement(String sql,
String[] columnNames)
throws SQLException
prepareStatement in interface ConnectionSQLException
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
prepareStatement in interface ConnectionSQLException
public PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws SQLException
prepareStatement in interface ConnectionSQLException
public void releaseSavepoint(Savepoint savepoint)
throws SQLException
releaseSavepoint in interface ConnectionSQLException
public void rollback(Savepoint savepoint)
throws SQLException
rollback in interface ConnectionSQLException
public void setCatalog(String catalog)
throws SQLException
setCatalog in interface ConnectionSQLException
public void setHoldability(int holdability)
throws SQLException
setHoldability in interface ConnectionSQLException
public void setReadOnly(boolean readOnly)
throws SQLException
setReadOnly in interface ConnectionSQLException
public Savepoint setSavepoint()
throws SQLException
setSavepoint in interface ConnectionSQLException
public Savepoint setSavepoint(String name)
throws SQLException
setSavepoint in interface ConnectionSQLException
public Map getTypeMap()
throws SQLException
getTypeMap in interface ConnectionSQLException
public void setTypeMap(Map map)
throws SQLException
setTypeMap in interface ConnectionSQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||