|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.p13n.util.jdbc.GenericDatabase | +--com.bea.p13n.util.jdbc.OracleDatabase
Provides partial implementation of common functionality for oracle jdbc drivers. Base class for oracle driver-specific Database instances to support reading/writing of CLOB data.
GenericDatabase
Constructor Summary | |
OracleDatabase(java.sql.Connection connection)
|
Method Summary | |
java.sql.Clob |
getClobLocator(java.sql.Connection con,
java.lang.String tableName,
java.lang.String clobColumnName,
java.lang.String whereClause)
|
java.lang.String |
getEmptyClobInitializer()
|
boolean |
setClob(java.sql.PreparedStatement stmt,
int index,
java.sql.Clob clob,
java.lang.String data)
Write to a CLOB. |
protected void |
trimClob(java.sql.Clob clob,
long newLength)
Trim a CLOB to desired size. |
void |
updateClob(ClobKey key,
java.lang.String data)
Updates a CLOB in the database managed tables for CLOB persistence |
Methods inherited from class com.bea.p13n.util.jdbc.GenericDatabase |
accept,
close,
close,
close,
close,
close,
close,
commitConnection,
createClobKey,
createPreparedStatement,
endClob,
getApplicationName,
getClob,
getClobTableName,
getConnection,
getName,
getProperty,
insertClob,
printSqlWarning,
readClob,
readFromClob,
readFromClob,
removeClob,
setClob,
startClob,
writeToClob,
writeToClob |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public OracleDatabase(java.sql.Connection connection)
Method Detail |
public void updateClob(ClobKey key, java.lang.String data) throws java.sql.SQLException
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 boolean setClob(java.sql.PreparedStatement stmt, int index, java.sql.Clob clob, java.lang.String data) throws java.sql.SQLException
stmt
- the PreparedStatementindex
- the paramater indexclob
- the CLOB locatorstr
- the string valueprotected void trimClob(java.sql.Clob clob, long newLength) throws java.sql.SQLException
If the newLength is greater than or equal to the current CLOB length (determined from Clob.length()) then nothing is done.
This trim is required because Oracle has some strange behavior for CLOB UPDATEs:
If you use UPDATE to put a small CLOB into a field that contains a larger CLOB, then the CLOB size remains unchanged. In other words, the new small CLOB data overlaps the large CLOB data and the end of the CLOB consists of the old data from the end of the large CLOB.
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |