|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.sysman.dbTarget.db.changemgr.emo.docaccess.CMConnection
public class CMConnection
CMConnection is a wrapper around an OracleConnection. In addition to providing the methods of OracleConnection, it maintains some information about the connection (such as the database version and compatible version) and supplies utility methods such as null-safe close() methods.
Constructor Summary | |
---|---|
CMConnection(oracle.jdbc.OracleConnection conn)
Creates a CMConnection. |
Method Summary | |
---|---|
boolean |
canAccessDbaViews()
|
void |
close()
Closes the OracleConnection |
static void |
close(java.sql.ResultSet rs)
Closes a result set. |
static void |
close(java.sql.Statement stmt)
Closes a statement. |
static void |
close(java.sql.Statement stmt,
java.sql.ResultSet rs)
Closes a statement and a result set. |
void |
commit()
Commits a DML operation on the connection. |
static int |
compareVersion(java.lang.String v1,
java.lang.String v2)
Shamelessly purloined from oracle.sysman.emSDK.core.util.jdk.VersionUtil. |
java.sql.Statement |
createStatement()
Creates a Statement using the connection. |
boolean |
getAutoCommit()
Sets the connection's auto-commit mode. |
java.lang.String |
getCompatibleVersion()
Returns the compatible version of the database accessed by the connection. |
java.lang.String |
getDBVersion()
Returns the version of the database accessed by the connection. |
oracle.jdbc.OracleConnection |
getUnWrappedConnection()
Returns the OracleConnection that is wrapped by the CMConnection. |
boolean |
isVersionEqualOrHigher(java.lang.String v2)
Indicates whether the version of the database accessed by this connection is equal to or higher than a specified database version. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Creates a CallableStatement using the connection. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Creates a PreparedStatement using the connection. |
void |
rollback()
Rolls back a DML operation on the connection. |
void |
setAutoCommit(boolean ac)
Sets the connection's auto-commit mode. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CMConnection(oracle.jdbc.OracleConnection conn)
conn
- the OracleConnection that is wrapped
by the CMConnection.Method Detail |
---|
public oracle.jdbc.OracleConnection getUnWrappedConnection()
public void close() throws java.sql.SQLException
java.sql.SQLException
public void setAutoCommit(boolean ac) throws java.sql.SQLException
ac
- true if the connection should
be set to auto-commit mode,
false if to manual commit.
java.sql.SQLException
public boolean getAutoCommit() throws java.sql.SQLException
java.sql.SQLException
public void commit() throws java.sql.SQLException
java.sql.SQLException
public void rollback() throws java.sql.SQLException
java.sql.SQLException
public java.sql.Statement createStatement() throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
sql
- The SQL to be executed by
the PreparedStatement.
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
sql
- The SQL to be executed by
the CallableStatement.
java.sql.SQLException
public java.lang.String getDBVersion()
public java.lang.String getCompatibleVersion()
public boolean isVersionEqualOrHigher(java.lang.String v2)
v2
- database version string
public static int compareVersion(java.lang.String v1, java.lang.String v2)
v1
- a version numberv2
- a version number
public static void close(java.sql.Statement stmt, java.sql.ResultSet rs)
stmt
- a Statementrs
- a ResultSetpublic boolean canAccessDbaViews() throws java.sql.SQLException
java.sql.SQLException
public static void close(java.sql.Statement stmt)
stmt
- a Statementpublic static void close(java.sql.ResultSet rs)
rs
- a ResultSet
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |