|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.dbobj.LOBSupport
Many databases support arbitrarily large objects. The problem with large objects is that their symantics are significantly different compared to other standard database fields. Specifically some highlighted differences are:
To support this, LOB Support is designed to provide several facilities to assist with this:
Delayed Loading: The LOBSupport class is activated by DBObjects only when a LOB data field's data is requested.
Separate command execution The LOBSupport executes a second statement to the database in the form of a PreparedStatement to retrieve all the Large Objects
Transaction usage IF supported If the JDBC driver indicates it supports transactions, LOBSupport will automatically attempt to setAutoCommit(false) and call explitic commit()s. If you are already within a transaction, LOBSupport will not attempt to get another transaction
Most often you would not use this class directly, but instead call the
similar DBObject method calls. However, sometimes access to
the lower level capabilities of these functions are useful for performance
sake and therefore...
com.jcorporate.expresso.core.dataobjcets.jdbc.LOBField,
MediaDBObject| Field Summary | |
protected static LOBSupport |
theInstance
Deprecated. |
| Constructor Summary | |
protected |
LOBSupport()
Deprecated. Default Constructor |
| Method Summary | |
protected void |
finalizeUpdate(DBConnection theConnection)
Deprecated. |
byte[] |
getBLOB(DBObject baseObject,
String fieldName,
DBConnection theConnection)
Deprecated. Returns a single stream for a LOB object. |
String |
getCLOB(DBObject baseObject,
String fieldName)
Deprecated. |
String |
getCLOB(DBObject baseObject,
String fieldName,
DBConnection theConnection)
Deprecated. Retrieves the CLOB data for the specified DBObject and the specified fieldName |
static LOBSupport |
getInstance()
Deprecated. Singleton implementation. |
protected void |
prepSelectResultSet(DBObject baseObject,
String fieldName,
DBConnection theConnection)
Deprecated. Internal helper function that does the guts of the work |
protected PreparedStatement |
prepUpdate(DBObject baseObject,
String fieldName,
DBConnection theConnection)
Deprecated. Internal helper function to prepare a LOB update |
void |
setBLOB(DBObject baseObject,
String fieldName,
byte[] theData,
DBConnection theConnection)
Deprecated. Updates the underlying table with a BLOB object. |
void |
setBLOB(DBObject baseObject,
String fieldName,
InputStream theData,
int dataLength,
DBConnection theConnection)
Deprecated. Updates the underlying table with a BLOB object. |
void |
setCLOB(DBObject baseObject,
String fieldName,
String theData,
DBConnection theConnection)
Deprecated. Writes a LONG Character string to the database. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static LOBSupport theInstance
| Constructor Detail |
protected LOBSupport()
| Method Detail |
public static LOBSupport getInstance()
public String getCLOB(DBObject baseObject,
String fieldName)
throws DBException
DBException
public String getCLOB(DBObject baseObject,
String fieldName,
DBConnection theConnection)
throws DBException
baseObject - The dbobject containing all the table information, and
key fields set.fieldName - The name of the field to retrieve as a LOB.theConnection - a DBConnection object that has already
been retrieved from the DBConnectionPool May be null although
it's not recommended for performance.
DBException - if there's an error executing the statement
public void setCLOB(DBObject baseObject,
String fieldName,
String theData,
DBConnection theConnection)
throws DBException
baseObject - The object that contains the metadata for this BLOBfieldName - the name of the field that is the BLOB fieldtheData - the data in a StringtheConnection - an already allocated DBConnection object Currently
may not be null
DBException - upon error
public byte[] getBLOB(DBObject baseObject,
String fieldName,
DBConnection theConnection)
throws DBException
baseObject - The dbobject containing all the table information, and
key fields set.fieldName - The name of the field to retrieve as a LOB.theConnection - a DBConnection object that has already
been retrieved from the DBConnectionPool
DBException - if there's an error executing the statement
public void setBLOB(DBObject baseObject,
String fieldName,
byte[] theData,
DBConnection theConnection)
throws DBException
baseObject - The object that contains the metadata for this BLOBfieldName - the name of the field that is the BLOB fieldtheData - the data in a byte arraytheConnection - an already allocated DBConnection object
DBException - upon error
public void setBLOB(DBObject baseObject,
String fieldName,
InputStream theData,
int dataLength,
DBConnection theConnection)
throws DBException
baseObject - The object that contains the metadata for this BLOBfieldName - the name of the field that is the BLOB fieldtheData - the data as an InputStreamdataLength - the total length to be read from the InputStreamtheConnection - an already allocated DBConnection object
DBException - upon error
protected void prepSelectResultSet(DBObject baseObject,
String fieldName,
DBConnection theConnection)
throws DBException
baseObject - The object that contains the metadata for this BLOBfieldName - the name of the field that is the BLOB fieldtheConnection - an already allocated DBConnection object. This
function modifies the state of theConnection by allocating a prepared
statement
DBException - upon error
protected PreparedStatement prepUpdate(DBObject baseObject,
String fieldName,
DBConnection theConnection)
throws DBException
baseObject - The object that contains the metadata for this BLOBfieldName - the name of the field that is the BLOB fieldtheConnection - an already allocated DBConnection object
DBException
protected void finalizeUpdate(DBConnection theConnection)
throws DBException
DBException
|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||