com.bea.p13n.util.jdbc
Class SetStringDatabase

java.lang.Object
  extended by com.bea.p13n.util.jdbc.GenericDatabase
      extended by com.bea.p13n.util.jdbc.SetStringDatabase
All Implemented Interfaces
Database

Deprecated No longer needed, as JDBC methods work with all supported drivers

@Deprecated
public class SetStringDatabase
extends GenericDatabase


Constructor Summary
SetStringDatabase(Connection connection)
          Deprecated  
 
Method Summary
 boolean commitConnection(Connection connection)
          Deprecated  
 String getClob(ResultSet rs, int index)
          Deprecated Get the value of a CLOB column as a string.
 String getName()
          Deprecated The name of this GenericDatabase instance.
 boolean setClob(PreparedStatement stmt, int index, Clob clob, String str)
          Deprecated 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.
 void setClob(PreparedStatement stmt, int index, String str)
          Deprecated Set the value of a CLOB column with a string.
 
Methods inherited from class com.bea.p13n.util.jdbc.GenericDatabase
accept, close, close, close, close, close, close, close, close, close, createPreparedStatement, endBlob, endClob, getApplicationName, getBlob, getBlobLocator, getClobLocator, getClobTableName, getConnection, getEmptyBlobInitializer, getEmptyClobInitializer, getProperty, printSqlWarning, readFromClob, readFromClob, startBlob, startClob, writeToClob, writeToClob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetStringDatabase

public SetStringDatabase(Connection connection)
Deprecated 
Method Detail

getClob

public String getClob(ResultSet rs,
                      int index)
               throws SQLException
Deprecated 
Description copied from interface: Database
Get the value of a CLOB column as a string.

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.

Specified by:
getClob in interface Database
Overrides:
getClob in class GenericDatabase
Parameters
rs - the result set.
index - the column index in the result set.
Returns
the column as a string.
Throws
SQLException - thrown on an error.

setClob

public void setClob(PreparedStatement stmt,
                    int index,
                    String str)
             throws SQLException
Deprecated 
Description copied from interface: Database
Set the value of a CLOB column with a string.

Specified by:
setClob in interface Database
Overrides:
setClob in class GenericDatabase
Parameters
stmt - the prepared statement.
index - the column index.
str - the CLOB string.
Throws
SQLException - thrown on an error.

setClob

public boolean setClob(PreparedStatement stmt,
                       int index,
                       Clob clob,
                       String str)
                throws SQLException
Deprecated 
Description copied from interface: Database
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.

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.

Specified by:
setClob in interface Database
Overrides:
setClob in class GenericDatabase
Parameters
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)
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
SQLException - thrown on an error.

commitConnection

public boolean commitConnection(Connection connection)
                         throws SQLException
Deprecated 
Specified by:
commitConnection in interface Database
Overrides:
commitConnection in class GenericDatabase
Throws
SQLException

getName

public String getName()
Deprecated 
Description copied from class: GenericDatabase
The name of this GenericDatabase instance.

Specified by:
getName in interface Database
Overrides:
getName in class GenericDatabase
Returns
the name of the database


Copyright © 2011, Oracle. All rights reserved.