wt.pds
Class AbstractLobHandler

java.lang.Object
  extended bywt.pds.AbstractLobHandler
All Implemented Interfaces:
LobHandler
Direct Known Subclasses:
BasicLobHandler, ChunkLobHandler

public abstract class AbstractLobHandler
extends Object
implements LobHandler

This abstract class provides common basic Lob handling operations in terms of low level access APIs that must be implemented by concrete subclasses.

Supported API: false

Extendable: false


Field Summary
private static String CLASSNAME
           
static boolean DEBUG
           
private static DebugWriter LOG
           
private static String RESOURCE
           
 
Constructor Summary
AbstractLobHandler()
           
 
Method Summary
protected  Object findLocator(WTConnection a_connection, LobLocator a_lobLocator)
          This method retrieves the Blob object from the database for the specified LobLocator.
 Object getBlob(ResultSet a_resultSet, int a_index)
          Gets the Blob object from the ResultSet.
 InputStream getLob(WTConnection a_connection, Object a_blob)
          Gets the data from the specified LOB as an InputStream.
 byte[] getLobAsByteArray(WTConnection a_connection, Object a_blob)
          Gets the Lob as a byte array.
 Object getLobAsObject(WTConnection a_connection, Object a_blob)
          Gets the Lob as an object.
 void setBlob(CallableStatement a_statement, int a_index, Object a_blob)
          Sets the Blob object in the CallableStatement.
abstract  long setLob(WTConnection a_connection, LobLocator a_lobLocator, InputStream a_inputStream)
          Set the data in the InputStream to the specified LOB.
abstract  void setLob(WTConnection a_connection, LobLocator a_lobLocator, InputStream a_inputStream, long a_length)
          Set the data in the InputStream to the specified LOB.
abstract  void setObjectAsLob(WTConnection a_connection, LobLocator a_lobLocator, Object a_object)
          Set the object as LOB.
 boolean streamAvailable(InputStream a_inputStream)
          

Supported API: false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEBUG

public static final boolean DEBUG

LOG

private static final DebugWriter LOG
Constructor Detail

AbstractLobHandler

public AbstractLobHandler()
Method Detail

findLocator

protected Object findLocator(WTConnection a_connection,
                             LobLocator a_lobLocator)
                      throws DatastoreException
This method retrieves the Blob object from the database for the specified LobLocator.

Supported API: false

Parameters:
a_connection -
a_lobLocator -
Returns:
Object
Throws:
DatastoreException

getLobAsObject

public Object getLobAsObject(WTConnection a_connection,
                             Object a_blob)
                      throws DatastoreException
Gets the Lob as an object.

Supported API: false

Specified by:
getLobAsObject in interface LobHandler
Parameters:
a_connection - Connection to the database
a_blob - Blob reference to the data
Returns:
Object
Throws:
DatastoreException

getLobAsByteArray

public byte[] getLobAsByteArray(WTConnection a_connection,
                                Object a_blob)
                         throws DatastoreException
Gets the Lob as a byte array.

Supported API: false

Specified by:
getLobAsByteArray in interface LobHandler
Parameters:
a_connection - Connection to the database
a_blob - Blob reference to the data
Returns:
byte[]
Throws:
DatastoreException

setLob

public abstract void setLob(WTConnection a_connection,
                            LobLocator a_lobLocator,
                            InputStream a_inputStream,
                            long a_length)
                     throws DatastoreException
Set the data in the InputStream to the specified LOB.

Supported API: false

Specified by:
setLob in interface LobHandler
Parameters:
a_connection - Connection to the database
a_lobLocator - specifies the Lob column
a_inputStream - Data stream for input to the lob
a_length - Number of bytes to set
Throws:
DatastoreException

setLob

public abstract long setLob(WTConnection a_connection,
                            LobLocator a_lobLocator,
                            InputStream a_inputStream)
                     throws DatastoreException
Set the data in the InputStream to the specified LOB.

Supported API: false

Specified by:
setLob in interface LobHandler
Parameters:
a_connection - Connection to the database
a_lobLocator - specifies the Lob column
a_inputStream - Data stream for input to the lob
Returns:
long
Throws:
DatastoreException

setObjectAsLob

public abstract void setObjectAsLob(WTConnection a_connection,
                                    LobLocator a_lobLocator,
                                    Object a_object)
                             throws DatastoreException
Set the object as LOB.

Supported API: false

Specified by:
setObjectAsLob in interface LobHandler
Parameters:
a_connection - Connection to the database
a_lobLocator - specifies the Lob column
a_object - Object to set
Throws:
DatastoreException

getLob

public InputStream getLob(WTConnection a_connection,
                          Object a_blob)
                   throws DatastoreException
Gets the data from the specified LOB as an InputStream.

Supported API: false

Specified by:
getLob in interface LobHandler
Parameters:
a_connection - Connection to the database
a_blob - Blob reference to the data
Returns:
InputStream
Throws:
DatastoreException

setBlob

public void setBlob(CallableStatement a_statement,
                    int a_index,
                    Object a_blob)
             throws SQLException
Sets the Blob object in the CallableStatement.

Supported API: false

Specified by:
setBlob in interface LobHandler
Parameters:
a_statement - instance to get Blob from
a_index - Index in result set to get Blob at
a_blob -
Throws:
SQLException

getBlob

public Object getBlob(ResultSet a_resultSet,
                      int a_index)
               throws SQLException
Gets the Blob object from the ResultSet.

Supported API: false

Specified by:
getBlob in interface LobHandler
Parameters:
a_resultSet - instance to get Blob from
a_index - Index in result set to get Blob at
Returns:
Object
Throws:
SQLException

streamAvailable

public boolean streamAvailable(InputStream a_inputStream)
                        throws DatastoreException


Supported API: false

Parameters:
a_inputStream -
Returns:
boolean
Throws:
DatastoreException