public class JDBCConnection extends java.lang.Object implements java.sql.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.
Modifier and Type | Method and Description |
---|---|
void |
clearWarnings() |
void |
close() |
void |
commit()
Commit the current transaction.
|
java.sql.Array |
createArrayOf(java.lang.String arg0,
java.lang.Object[] arg1) |
java.sql.Blob |
createBlob() |
java.sql.Clob |
createClob() |
java.sql.Statement |
createStatement() |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Only valid for ResultSet.TYPE_FORWARD_ONLY and ResultSet.CONCUR_READ_ONLY.
|
java.sql.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.
|
java.sql.Struct |
createStruct(java.lang.String arg0,
java.lang.Object[] arg1) |
boolean |
getAutoCommit()
Return the autocommit setting.
|
java.lang.String |
getCatalog()
Not implemented.
|
java.util.Properties |
getClientInfo() |
java.lang.String |
getClientInfo(java.lang.String arg0) |
static JDBCConnection |
getConnection(boolean isSSL,
java.lang.String system,
java.lang.String user,
java.lang.String password,
boolean debug) |
static JDBCConnection |
getConnection(java.lang.String system,
java.lang.String user,
java.lang.String password,
boolean debug) |
int |
getHoldability()
The holdability is always ResultSet.HOLD_CURSORS_OVER_COMMIT.
|
java.sql.DatabaseMetaData |
getMetaData()
Returns the metadata for this connection.
|
java.lang.String |
getServerJobIdentifier() |
protected int |
getServerVersion()
Return the version level.
|
int |
getTransactionIsolation()
Not implemented.
|
java.util.Map |
getTypeMap()
Not implemented.
|
java.lang.String |
getURL() |
java.lang.String |
getUserName() |
java.sql.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) |
java.lang.String |
nativeSQL(java.lang.String sql)
Not implemented.
|
void |
newMessageID(java.lang.String id) |
void |
newMessageText(java.lang.String text) |
void |
newSecondLevelText(java.lang.String text) |
void |
newWarning(int rcClass,
int rcClassReturnCode) |
void |
noWarnings() |
java.sql.CallableStatement |
prepareCall(java.lang.String sql) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndices)
Not implemented.
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Only implemented for ResultSet.TYPE_FORWARD_ONLY and ResultSet.CONCUR_READ_ONLY.
|
java.sql.PreparedStatement |
prepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
Not implemented.
|
void |
releaseSavepoint(java.sql.Savepoint savepoint)
Not implemented.
|
void |
rollback()
Rollback the current transaction.
|
void |
rollback(java.sql.Savepoint savepoint)
Not implemented.
|
void |
setAutoCommit(boolean autoCommit)
Set the autocommit level.
|
void |
setCatalog(java.lang.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.
|
java.sql.Savepoint |
setSavepoint()
Not implemented.
|
java.sql.Savepoint |
setSavepoint(java.lang.String name)
Not implemented.
|
void |
setTransactionIsolation(int level)
sets the isolation level used by the connection.
|
void |
setTypeMap(java.util.Map map)
Not implemented.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void newWarning(int rcClass, int rcClassReturnCode)
newWarning
in interface DatabaseWarningCallback
public void noWarnings()
noWarnings
in interface DatabaseWarningCallback
public void newMessageID(java.lang.String id)
newMessageID
in interface DatabaseWarningCallback
public void newMessageText(java.lang.String text)
newMessageText
in interface DatabaseWarningCallback
public void newSecondLevelText(java.lang.String text)
newSecondLevelText
in interface DatabaseWarningCallback
public static JDBCConnection getConnection(java.lang.String system, java.lang.String user, java.lang.String password, boolean debug) throws java.sql.SQLException
java.sql.SQLException
public static JDBCConnection getConnection(boolean isSSL, java.lang.String system, java.lang.String user, java.lang.String password, boolean debug) throws java.sql.SQLException
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface java.sql.Connection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public java.util.Map getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndices) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
public void setHoldability(int holdability) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public void setTypeMap(java.util.Map map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
java.sql.SQLException
protected int getServerVersion() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getUserName() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getURL() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getServerJobIdentifier()
public java.sql.Array createArrayOf(java.lang.String arg0, java.lang.Object[] arg1) throws java.sql.SQLException
createArrayOf
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Blob createBlob() throws java.sql.SQLException
createBlob
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Clob createClob() throws java.sql.SQLException
createClob
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Struct createStruct(java.lang.String arg0, java.lang.Object[] arg1) throws java.sql.SQLException
createStruct
in interface java.sql.Connection
arg0
- arg1
- java.sql.SQLException
public java.util.Properties getClientInfo() throws java.sql.SQLException
getClientInfo
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String getClientInfo(java.lang.String arg0) throws java.sql.SQLException
getClientInfo
in interface java.sql.Connection
arg0
- java.sql.SQLException
public boolean isValid(int arg0) throws java.sql.SQLException
isValid
in interface java.sql.Connection
arg0
- java.sql.SQLException