Provides various BLOB and CLOB handling methods, as well as validity-checking for
database drivers. Sub-classed by GenericDatabase
.
Related Topics
GenericDatabase
Method Summary |
public boolean |
|
public void |
|
public void | |
public void |
|
public void | |
public void |
|
public void | |
public void |
|
public void | |
public void | |
public boolean |
|
public void |
|
public void |
|
public |
|
public byte[] | |
public |
|
public | |
public |
|
public |
|
public | |
public | |
public |
|
public |
|
public void |
|
public boolean |
|
public void |
|
public void |
|
public void |
|
Method Detail |
public boolean accept(Connection
connection)
Check to see if the Database can bind to the supplied connection.
public void close()Close the Connection associated with this Database.
public void close(Reader
reader)
Closes a Reader stream.
public void close(InputStream
is)
Closes an InputStream.
public void close(Writer
writer)
Closes a Writer stream.
public void close(OutputStream
os)
Closes an OutputStream.
public void close(Statement
stmt)
Closes a Statement.
public void close(PreparedStatement
ps)
Closes a PreparedStatement.
public void close(ResultSet
rs)
Closes a ResultSet.
public void close(Closes a ResultSet and its associated Statement.ResultSet
rs,Statement
stmt)
public boolean commitConnection(Connection
connection)
throwsSQLException
SQLException
public void endBlob()Call Connection.commit().
throwsSQLException
SQLException
public void endClob()Call Connection.commit().
throwsSQLException
SQLException
public String
getApplicationName()
Get the name of the current WebLogic J2EE application
or return null if not running within a WebLogic J2EE
context.
public byte[] getBlob(Get the value of a Blob column as an InputStream.ResultSet
rs, int index)
throwsSQLException
This method will only return the value of the Blob 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.
SQLException
publicOutputStream
getBlobLocator(Connection
con,String
tableName,String
blobColumnName,String
whereClause)
throwsSQLException
SQLException
publicGet the value of a CLOB column as a string.String
getClob(ResultSet
rs, int index)
throwsSQLException
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.
SQLException
publicClob
getClobLocator(Connection
con,String
tableName,String
clobColumnName,String
whereClause)
throwsSQLException
SQLException
public Connection
getConnection()
Return Connection for the current Database instance.
publicString
getEmptyBlobInitializer()
throwsSQLException
SQLException
publicString
getEmptyClobInitializer()
throwsSQLException
SQLException
public String
getName()
Gets the name of the database instance.
publicReads the contents of a Clob and returns as a String.String
readFromClob(Clob
clob)
throwsSQLException
SQLException
public void setClob(Set the value of a CLOB column with a string.PreparedStatement
stmt, int index,String
str)
throwsSQLException
SQLException
public boolean setClob(If there is a delegate, this method uses JdbcHelperDelegate.writeClobData() If this is done, then the PreparedStatement does not need to be used and the return value, executeRequired, is false. The CLOB should be first located with getClobLocator() If there is no delegate, then this method ignores the Clob argument and sets the value of the String into the CLOB placeholder in the PreparedStatement with setClob(PreparedStatement stmt, int index, String str) and returns executeRequired = true.PreparedStatement
stmt, int index,Clob
clob,String
str)
throwsSQLException
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.
SQLException
public void startBlob()setAutoCommit( false ) on the Connection.
throwsSQLException
SQLException
public void startClob()setAutoCommit( false ) on the Connection.
throwsSQLException
SQLException
public void writeToClob(Writes the data from a String into a Clob.Clob
clob,String
data)
throwsSQLException
SQLException