|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.p13n.util.jdbc.JdbcHelper
See also the Database and DatabaseFactory classes.
Method Summary | |
static void |
close(Connection con)
Close a connection, ignoring any errors. |
static void |
close(ResultSet rs)
Close a result set, ignoring any errors. |
static void |
close(ResultSet rs,
Statement stmt,
Connection con)
Close a connection, statement and resultset, ignoring errors. |
static void |
close(Statement stmt)
Close a statement, ignoring any errors. |
static void |
commitConnection(Connection con)
Deprecated. in favor of Database.commitConnection() |
static String |
getClob(ResultSet rs,
int index)
Deprecated. in favor of Database and DatabaseFactory |
static Clob |
getClobLocator(Connection con,
String tableName,
String clobColumnName,
String whereClause)
Deprecated. in favor of Database and DatabaseFactory |
static Connection |
getConnection(DataSource src,
int retries)
Deprecated. Use DataSource.getConnection(), set retries and waitTime by configuring the Pool |
static Connection |
getConnection(DataSource src,
int retries,
long waitTime)
Deprecated. Use DataSource.getConnection(), set retries and waitTime by configuring the Pool |
static String |
getEmptyClobInitializer()
Deprecated. in favor of Database and DatabaseFactory |
static JdbcHelper |
getInstance()
|
static void |
resumeTransaction(Transaction suspendedTransaction)
Resumes the suspended transaction if it is not null. |
static boolean |
setClob(PreparedStatement stmt,
int index,
Clob clob,
String str)
Deprecated. in favor of Database.setClob() |
static void |
setClob(PreparedStatement stmt,
int index,
String str)
Deprecated. in favor of Database.setClob() |
static void |
setJdbcHelperDelegate(String className)
Deprecated. in favor of DatabaseFactory |
static String |
showIsolationLevel(Connection connection)
Show transaction isolation level of connection |
static UserTransaction |
startTransaction()
Start a new transaction |
static Transaction |
suspendTransaction()
Suspend any current transaction (unless suspendTransaction is false). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void close(Connection con)
con
- The Connection object to be closed.public static void close(ResultSet rs)
rs
- The ResultSet object to be closed.public static void close(ResultSet rs, Statement stmt, Connection con)
rs
- The ResultSet object to be closed.stmt
- The Statement object to be closed.con
- The Connection object to be closed.public static void close(Statement stmt)
stmt
- The Statement object to be closed.public static void commitConnection(Connection con) throws SQLException
The delegate may implement this as a no-op method if it is illegal to do a Connection.commit() for the driver (e.g., jDriver for Oracle XA)
If there is no delegate, this method does a Connection.commit()
con
- the Connection
SQLException
- on an errorpublic static String getClob(ResultSet rs, int index) throws SQLException
This method will only return the value of the CLOB in the current row of the ResultSet. This method does not increment the ResultSet cursor. You must use ResultSet.next() to increment the cursor before calling this method. This allows the method to be used to process multi-row ResultSets.
rs
- the result set.index
- the column index in the result set.
SQLException
- thrown on an error.public static Clob getClobLocator(Connection con, String tableName, String clobColumnName, String whereClause) throws SQLException
This method only returns a single CLOB locator. If the WHERE clause results in mutiple rows, only the CLOB from the first row is returned.
If no JdbcHelperDelegate is specified in application-config.xml then this method will return null.
WARNING: if using a delegate to stream data to a CLOB, then you should use Connection.setAutoCommit(false) before calling this method. This will make the CLOB available across multiple SQL statements.
con
- the database connectiontableName
- the name of the database tableclobColumnName
- the name of the column holding the CLOBwhereClause
- the where clause (without WHERE keyword)
SQLException
- on an errorpublic static Connection getConnection(DataSource src, int retries) throws SQLException
This method no longer honors the retry parameter; it will use the 'Connection Reserve Timeout' parameter set on the JdbcConnectionPool cia the WLS console settings.
src
- the data source.retries
- No longer used - the settings on the pool are now used
SQLException
- thrown on an error getting a connection.public static Connection getConnection(DataSource src, int retries, long waitTime) throws SQLException
This method no longer honors the retry parameter; it will use the 'Connection Reserve Timeout' parameter set on the JdbcConnectionPool via the WLS console settings.
src
- the data source.retries
- No longer used - the settings on the pool are now usedwaitTime
- No longer used - the settings on the pool are now used
SQLException
- thrown on an error getting a connection.public static String getEmptyClobInitializer() throws SQLException
For example, the method returns EMPTY_CLOB() when an Oracle delegate is used.
SQLException
- on an errorpublic static JdbcHelper getInstance()
public static void resumeTransaction(Transaction suspendedTransaction)
public static boolean setClob(PreparedStatement stmt, int index, Clob clob, String str) throws SQLException
WARNING: if using a delegate to stream data to a CLOB, then you should have used Connection.setAutoCommit(false) before calling the CLOB locator method that provided the Clob you are using in this method call. This will make the CLOB available across multiple SQL statements.
stmt
- the prepared statement.index
- the column index.clob
- the CLOB locator (ignored if no delegate).str
- the String to be set in the CLOB (if delegate) or in the PreparedStatement (if no delegate)
SQLException
- thrown on an error.JdbcHelperDelegate.writeClobData(PreparedStatement,int,Clob,String)
,
getClobLocator(Connection,String,String,String)
,
setClob(PreparedStatement,int,String)
public static void setClob(PreparedStatement stmt, int index, String str) throws SQLException
stmt
- the prepared statement.index
- the column index.str
- the CLOB string.
SQLException
- thrown on an error.public static void setJdbcHelperDelegate(String className)
public static String showIsolationLevel(Connection connection) throws SQLException
SQLException
public static UserTransaction startTransaction() throws SQLException
SQLException
public static Transaction suspendTransaction()
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |