© 2002 BEA Systems, Inc.


com.bea.p13n.util.jdbc
Interface JdbcHelperDelegate


public interface JdbcHelperDelegate

Interface for the JdbcHelperDelegate, which is used to delegate CLOB read/write operations for specific database drivers.


Method Summary
 void commitConnection(java.sql.Connection con)
          Deprecated. Commits the java.sql.Connection that you have been using for CLOB operations.
 java.sql.Clob getClobLocator(java.sql.Connection con, java.lang.String tableName, java.lang.String clobColumnName, java.lang.String whereClause)
          Deprecated. Retrieve the LOB locator for a CLOB.
 java.lang.String getEmptyClobInitializer()
          Deprecated. Return the database specific keyword that must be used when inserting a row with an empty CLOB.
 java.lang.String readClobData(java.sql.ResultSet rs, int index)
          Deprecated. Retrieve CLOB value as a String of Unicode characters.
 boolean writeClobData(java.sql.PreparedStatement stmt, int index, java.sql.Clob clob, java.lang.String str)
          Deprecated. Write to a CLOB.
 

Method Detail

getEmptyClobInitializer

public java.lang.String getEmptyClobInitializer()
                                         throws java.sql.SQLException
Deprecated. 
Return the database specific keyword that must be used when inserting a row with an empty CLOB. For example, the method returns EMPTY_CLOB() when the database is Oracle.

Returns:
keyword required to insert an empty CLOB, return empty String if not supported
Throws:
java.sql.SQLException - on an error

getClobLocator

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
Deprecated. 
Retrieve the LOB locator for a CLOB. The method creates a PreparedStatement from the specified parameters and gets the LOB locator from the ResultSet.

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.

Parameters:
con - the database connection
tableName - the name of the database table
clobColumnName - the name of the column holding the CLOB
whereClause - the where clause (without WHERE keyword)
Returns:
a CLOB locator, return null if the ResultSet is empty
Throws:
java.sql.SQLException - on an error

readClobData

public java.lang.String readClobData(java.sql.ResultSet rs,
                                     int index)
                              throws java.sql.SQLException
Deprecated. 
Retrieve CLOB value as a String of Unicode characters.

Parameters:
rs - the resultset containing the clob
index - the position of the clob in the resultset
Returns:
the value of the CLOB as a String.
Throws:
java.sql.SQLException - on an error
See Also:
#getClob(ResultSet rs, int index)

writeClobData

public boolean writeClobData(java.sql.PreparedStatement stmt,
                             int index,
                             java.sql.Clob clob,
                             java.lang.String str)
                      throws java.sql.SQLException
Deprecated. 
Write to a CLOB. Write the input stream containing the ASCII data associated with the passed String to the CLOB's output stream. Streams support for updating CLOB columns is not addressed by JDBC 2.0 so this method uses an extension implemented in the delegate.

Parameters:
stmt - the PreparedStatement
index - the paramater index
clob - the CLOB locator
str - the string value
Returns:
boolean executeRequired. If false then a delegate was used to directly set the CLOB in the database without using the PreparedStatement. If true then no delegate was used, or the delegate set the Clob value on the statement and the PreparedStatement must be executed to update the database.
Throws:
java.sql.SQLException - on an error

commitConnection

public void commitConnection(java.sql.Connection con)
                      throws java.sql.SQLException
Deprecated. 
Commits the java.sql.Connection that you have been using for CLOB operations. A CLOB becomes inactive as soon as a transaction is committed. You must have auto-commit=false on your connection if you need to have a CLOB available across multiple SQL statements.

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)

Parameters:
con - the Connection
Throws:
java.sql.SQLException - on an error

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved