DbStorage.manager
Class ClobManager

java.lang.Object
  extended byDbStorage.manager.ClobManager

public final class ClobManager
extends java.lang.Object

This class implements the metods to storage CLOB objects.


Constructor Summary
ClobManager()
           
 
Method Summary
static long getLength(DbStorageManager dbsm, long transactionNumber, PhysicalID id)
          Returns the length of the CLOB datum.
static java.lang.String read(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long from, int maxLength)
          Reads from a CLOB datum and stores the readed in a string.
static void setLength(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long newLength)
          Changes the length of the CLOB datum.
static int write(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long from, int maxLength, java.lang.String str, int off)
          Writes a byte array into a CLOB datum.
static int write(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long from, java.lang.String str)
          Writes a byte array into a CLOB datum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClobManager

public ClobManager()
Method Detail

setLength

public static void setLength(DbStorageManager dbsm,
                             long transactionNumber,
                             PhysicalID id,
                             long newLength)
                      throws storage.StorageException,
                             java.io.IOException,
                             OutOfLOBException
Changes the length of the CLOB datum.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to resize.
newLength - The new length of the datum (in characters).
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException

getLength

public static long getLength(DbStorageManager dbsm,
                             long transactionNumber,
                             PhysicalID id)
                      throws storage.StorageException,
                             java.io.IOException
Returns the length of the CLOB datum.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to resize.
Returns:
The length of the datum (in characters).
Throws:
storage.StorageException
java.io.IOException

write

public static int write(DbStorageManager dbsm,
                        long transactionNumber,
                        PhysicalID id,
                        long from,
                        int maxLength,
                        java.lang.String str,
                        int off)
                 throws storage.StorageException,
                        java.io.IOException,
                        OutOfLOBException
Writes a byte array into a CLOB datum.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to wrote.
from - The position of the CLOB from which the witting starts.
maxLength - The maximum number of characters to write.
str - The string contains the characters to write.
off - The offset of str from which the characters are retrieved.
Returns:
The number of written characters.
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException

write

public static int write(DbStorageManager dbsm,
                        long transactionNumber,
                        PhysicalID id,
                        long from,
                        java.lang.String str)
                 throws storage.StorageException,
                        java.io.IOException,
                        OutOfLOBException
Writes a byte array into a CLOB datum.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to wrote.
from - The position of the CLOB from which the witting starts.
str - The string contains the characters to write.
Returns:
The number of written characters.
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException

read

public static java.lang.String read(DbStorageManager dbsm,
                                    long transactionNumber,
                                    PhysicalID id,
                                    long from,
                                    int maxLength)
                             throws storage.StorageException,
                                    java.io.IOException,
                                    OutOfLOBException
Reads from a CLOB datum and stores the readed in a string.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to read.
from - The position of the CLOB from which the reading starts.
maxLength - The maximum number of characters to read.
Returns:
A string contains the readed characters.
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException