public class JDBCConnection extends Object implements Connection, DatabaseWarningCallback
The JDBCConnection class provides a JDBC connection to a specific DB2 for IBM i database. Use DriverManager.getConnection() with a jdbc:jtopenlite://SYSTENAME URL to create AS400JDBCConnection objects.
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
Modifier and Type | Method and Description |
---|---|
void |
clearWarnings() |
void |
close() |
void |
commit()
Commit the current transaction.
|
Array |
createArrayOf(String arg0,
Object[] arg1) |
Blob |
createBlob() |
Clob |
createClob() |
Statement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Only valid for ResultSet.TYPE_FORWARD_ONLY and ResultSet.CONCUR_READ_ONLY.
|
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Only valid for ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, and ResultSet.HOLD_CURSORS_OVER_COMMIT.
|
Struct |
createStruct(String arg0,
Object[] arg1) |
boolean |
getAutoCommit()
Return the autocommit setting.
|
String |
getCatalog()
Not implemented.
|
Properties |
getClientInfo() |
String |
getClientInfo(String arg0) |
static JDBCConnection |
getConnection(boolean isSSL,
String system,
String user,
String password,
boolean debug) |
static JDBCConnection |
getConnection(String system,
String user,
String password,
boolean debug) |
int |
getHoldability()
The holdability is always ResultSet.HOLD_CURSORS_OVER_COMMIT.
|
DatabaseMetaData |
getMetaData()
Returns the metadata for this connection.
|
String |
getServerJobIdentifier() |
protected int |
getServerVersion()
Return the version level.
|
int |
getTransactionIsolation()
Not implemented.
|
Map |
getTypeMap()
Not implemented.
|
String |
getURL() |
String |
getUserName() |
SQLWarning |
getWarnings()
Returns null because get warnings is not implemented on this driver.
|
boolean |
isClosed() |
boolean |
isReadOnly()
The driver does not allow readonly to be specified.
|
boolean |
isValid(int arg0) |
String |
nativeSQL(String sql)
Not implemented.
|
void |
newMessageID(String id) |
void |
newMessageText(String text) |
void |
newSecondLevelText(String text) |
void |
newWarning(int rcClass,
int rcClassReturnCode) |
void |
noWarnings() |
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[] columnIndices)
Not implemented.
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
Only implemented for ResultSet.TYPE_FORWARD_ONLY and ResultSet.CONCUR_READ_ONLY.
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Only implemented for ResultSet.TYPE_FORWARD_ONLY and ResultSet.CONCUR_READ_ONLY and ResultSet.HOLD_CURSORS_OVER_COMMIT.
|
PreparedStatement |
prepareStatement(String sql,
String[] columnNames)
Not implemented.
|
void |
releaseSavepoint(Savepoint savepoint)
Not implemented.
|
void |
rollback()
Rollback the current transaction.
|
void |
rollback(Savepoint savepoint)
Not implemented.
|
void |
setAutoCommit(boolean autoCommit)
Set the autocommit level.
|
void |
setCatalog(String catalog)
Not implemented.
|
void |
setHoldability(int holdability)
The only allowed holdability is to hold cursors over commit.
|
void |
setReadOnly(boolean readOnly)
The default setting if false.
|
Savepoint |
setSavepoint()
Not implemented.
|
Savepoint |
setSavepoint(String name)
Not implemented.
|
void |
setTransactionIsolation(int level)
sets the isolation level used by the connection.
|
void |
setTypeMap(Map map)
Not implemented.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createNClob, createSQLXML, setClientInfo, setClientInfo
isWrapperFor, unwrap
public void newWarning(int rcClass, int rcClassReturnCode)
newWarning
in interface DatabaseWarningCallback
public void noWarnings()
noWarnings
in interface DatabaseWarningCallback
public void newMessageID(String id)
newMessageID
in interface DatabaseWarningCallback
public void newMessageText(String text)
newMessageText
in interface DatabaseWarningCallback
public void newSecondLevelText(String text)
newSecondLevelText
in interface DatabaseWarningCallback
public static JDBCConnection getConnection(String system, String user, String password, boolean debug) throws SQLException
SQLException
public static JDBCConnection getConnection(boolean isSSL, String system, String user, String password, boolean debug) throws SQLException
SQLException
public void clearWarnings() throws SQLException
clearWarnings
in interface Connection
SQLException
public void close() throws SQLException
close
in interface Connection
SQLException
public void commit() throws SQLException
commit
in interface Connection
SQLException
public Statement createStatement() throws SQLException
createStatement
in interface Connection
SQLException
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
createStatement
in interface Connection
SQLException
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement
in interface Connection
SQLException
public boolean getAutoCommit() throws SQLException
getAutoCommit
in interface Connection
SQLException
public String getCatalog() throws SQLException
getCatalog
in interface Connection
SQLException
public int getHoldability() throws SQLException
getHoldability
in interface Connection
SQLException
public DatabaseMetaData getMetaData() throws SQLException
getMetaData
in interface Connection
SQLException
public int getTransactionIsolation() throws SQLException
getTransactionIsolation
in interface Connection
SQLException
public Map getTypeMap() throws SQLException
getTypeMap
in interface Connection
SQLException
public SQLWarning getWarnings() throws SQLException
getWarnings
in interface Connection
SQLException
public boolean isClosed() throws SQLException
isClosed
in interface Connection
SQLException
public boolean isReadOnly() throws SQLException
isReadOnly
in interface Connection
SQLException
public String nativeSQL(String sql) throws SQLException
nativeSQL
in interface Connection
SQLException
public CallableStatement prepareCall(String sql) throws SQLException
prepareCall
in interface Connection
SQLException
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareCall
in interface Connection
SQLException
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int[] columnIndices) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement
in interface Connection
SQLException
public void releaseSavepoint(Savepoint savepoint) throws SQLException
releaseSavepoint
in interface Connection
SQLException
public void rollback() throws SQLException
rollback
in interface Connection
SQLException
public void rollback(Savepoint savepoint) throws SQLException
rollback
in interface Connection
SQLException
public void setAutoCommit(boolean autoCommit) throws SQLException
setAutoCommit
in interface Connection
SQLException
public void setCatalog(String catalog) throws SQLException
setCatalog
in interface Connection
SQLException
public void setHoldability(int holdability) throws SQLException
setHoldability
in interface Connection
SQLException
public void setReadOnly(boolean readOnly) throws SQLException
setReadOnly
in interface Connection
SQLException
public Savepoint setSavepoint() throws SQLException
setSavepoint
in interface Connection
SQLException
public Savepoint setSavepoint(String name) throws SQLException
setSavepoint
in interface Connection
SQLException
public void setTransactionIsolation(int level) throws SQLException
setTransactionIsolation
in interface Connection
SQLException
public void setTypeMap(Map map) throws SQLException
setTypeMap
in interface Connection
SQLException
protected int getServerVersion() throws SQLException
SQLException
public String getUserName() throws SQLException
SQLException
public String getURL() throws SQLException
SQLException
public String getServerJobIdentifier()
public Array createArrayOf(String arg0, Object[] arg1) throws SQLException
createArrayOf
in interface Connection
SQLException
public Blob createBlob() throws SQLException
createBlob
in interface Connection
SQLException
public Clob createClob() throws SQLException
createClob
in interface Connection
SQLException
public Struct createStruct(String arg0, Object[] arg1) throws SQLException
createStruct
in interface Connection
arg0
- arg1
- SQLException
public Properties getClientInfo() throws SQLException
getClientInfo
in interface Connection
SQLException
public String getClientInfo(String arg0) throws SQLException
getClientInfo
in interface Connection
arg0
- SQLException
public boolean isValid(int arg0) throws SQLException
isValid
in interface Connection
arg0
- SQLException