|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides various CLOB-handling methods, as well as validity-checking for
various database drivers. Sub-classed by GenericDatabase
.
GenericDatabase
Method Summary | |
boolean |
accept(java.sql.Connection connection)
|
void |
close()
Close the Connection associated with this Database |
void |
close(java.io.Reader reader)
Closes a Reader ignoring any exceptions. |
void |
close(java.sql.ResultSet rs)
Close a result set, ignoring any errors. |
void |
close(java.sql.ResultSet rs,
java.sql.Statement stmt)
Close a connection, statement and resultset, ignoring errors. |
void |
close(java.sql.Statement stmt)
Close a statement, ignoring any errors. |
void |
close(java.io.Writer writer)
Closes a Writer ignoring any exceptions. |
boolean |
commitConnection(java.sql.Connection connection)
|
void |
endClob()
Call Connection.commit |
java.lang.String |
getApplicationName()
Get the name of the current WebLogic J2EE application or return null if not running within a WebLogic J2EE context. |
java.lang.String |
getClob(java.sql.ResultSet rs,
int index)
Get the value of a CLOB column as a string. |
java.sql.Clob |
getClobLocator(java.sql.Connection con,
java.lang.String tableName,
java.lang.String clobColumnName,
java.lang.String whereClause)
|
java.sql.Connection |
getConnection()
|
java.lang.String |
getEmptyClobInitializer()
|
java.lang.String |
getName()
|
java.lang.String |
readFromClob(java.sql.Clob clob)
Reads the contents of a Clob and returns as a String. |
boolean |
setClob(java.sql.PreparedStatement stmt,
int index,
java.sql.Clob clob,
java.lang.String str)
If there is a delegate, this method uses JdbcHelperDelegate.writeClobData(). |
void |
setClob(java.sql.PreparedStatement stmt,
int index,
java.lang.String str)
Set the value of a CLOB column with a string. |
void |
startClob()
setAutoCommit( false ) on the Connection |
void |
writeToClob(java.sql.Clob clob,
java.lang.String data)
Writes the data from the String into the Clob. |
Method Detail |
public java.sql.Connection getConnection()
public boolean accept(java.sql.Connection connection)
public void close()
public void close(java.io.Reader reader)
public void close(java.io.Writer writer)
public void close(java.sql.Statement stmt)
stmt
- The Statement object to be closed.public void close(java.sql.ResultSet rs)
rs
- The ResultSet object to be closed.public void close(java.sql.ResultSet rs, java.sql.Statement stmt)
rs
- The ResultSet object to be closed.stmt
- The Statement object to be closed.con
- The Connection object to be closed.public java.lang.String readFromClob(java.sql.Clob clob) throws java.sql.SQLException
public void writeToClob(java.sql.Clob clob, java.lang.String data) throws java.sql.SQLException
public void startClob() throws java.sql.SQLException
public void endClob() throws java.sql.SQLException
public java.lang.String getApplicationName()
public java.lang.String getName()
public java.lang.String getEmptyClobInitializer() throws java.sql.SQLException
public java.sql.Clob getClobLocator(java.sql.Connection con, java.lang.String tableName, java.lang.String clobColumnName, java.lang.String whereClause) throws java.sql.SQLException
public java.lang.String getClob(java.sql.ResultSet rs, int index) throws java.sql.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.
If no JdbcHelperDelegate is specified in the console (configured via JdbcHelperMBean) then this method will return a string obtained using the default method that was used before a delegate model was implemented for this class. That method uses Clob.getCharacterStream() to construct a BufferedReader that is read in with the readLine() method.
rs
- the result set.index
- the column index in the result set.public void setClob(java.sql.PreparedStatement stmt, int index, java.lang.String str) throws java.sql.SQLException
stmt
- the prepared statement.index
- the column index.str
- the CLOB string.public boolean setClob(java.sql.PreparedStatement stmt, int index, java.sql.Clob clob, java.lang.String str) throws java.sql.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)public boolean commitConnection(java.sql.Connection connection) throws java.sql.SQLException
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |