OpenAPI 1.0

com.aquafold.openapi.rdbms
Interface AQSQLClob

All Known Subinterfaces:
AQSQLNClob

public interface AQSQLClob

This class describes a SQL CLOB object.


Method Summary
 void free()
          This method frees the Clob object and releases the resources the resources that it holds.
 long getLength()
          Retrieves the number of characters in the CLOB value designated by this Clob object.
 String getSubString(long pos, int length)
          Retrieves a copy of the specified substring in the CLOB value designated by this Clob object.
 long position(String str, int start)
          Retrieves the character position at which the specified String str appears in this Clob object.
 int setString(long pos, String str)
          Writes the given string to the CLOB value that this Clob object designates at the position pos.
 int setString(long pos, String str, int offset, int len)
          Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents.
 

Method Detail

free

void free()
          throws Exception
This method frees the Clob object and releases the resources the resources that it holds.
After free has been called, any attempt to invoke a method other than free will result in a SQLException being thrown. If free is called multiple times, the subsequent calls to free are treated as a no-op.

Throws:
Exception - If an error occurs releasing the Clob's resources.
if the JDBC driver does not support this method.

getLength

long getLength()
               throws Exception
Retrieves the number of characters in the CLOB value designated by this Clob object.

Returns:
Length of the CLOB in characters.
Throws:
Exception - If there is an error accessing the length of the CLOB value.

position

long position(String str,
              int start)
              throws Exception
Retrieves the character position at which the specified String str appears in this Clob object. The search begins at position start.

Parameters:
str - The string for which to search.
start - The position at which to begin searching; the first position is 0.
Returns:
The position at which the string appears or -1 if it is not present; the first position is 0.
Throws:
Exception - If there is an error accessing the CLOB value or if start is less than 0.

getSubString

String getSubString(long pos,
                    int length)
                    throws Exception
Retrieves a copy of the specified substring in the CLOB value designated by this Clob object. The substring begins at position pos and has up to length consecutive characters.

Parameters:
pos - The first character of the substring to be extracted. The first character is at position 0.
length - The number of consecutive characters to be copied; the value for length must be 0 or greater.
Returns:
A String that is the specified substring in the CLOB value designated by this Clob object.
Throws:
Exception - If there is an error accessing the CLOB value; if pos is less than 1 or length is less than 0.

setString

int setString(long pos,
              String str)
              throws Exception
Writes the given string to the CLOB value that this Clob object designates at the position pos. The string will overwrite the existing characters in the Clob object starting at the position pos. If the end of the Clob value is reached while writing the given string, then the length of the Clob value will be increased to accommodate the extra characters.

Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined.

Parameters:
pos - The position at which to start writing to the CLOB value that this Clob object represents; The first position is 0.
str - The string to be written to the CLOB value that this Clob designates.
Returns:
The number of characters written.
Throws:
Exception - If there is an error accessing the CLOB value or if pos is less than 0.

setString

int setString(long pos,
              String str,
              int offset,
              int len)
              throws Exception
Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents. The string will overwrite the existing characters in the Clob object starting at the position pos. If the end of the Clob value is reached while writing the given string, then the length of the Clob value will be increased to accomodate the extra characters.

Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined.

Parameters:
pos - The position at which to start writing to this CLOB object; The first position is 0.
str - The string to be written to the CLOB value that this Clob object represents.
offset - The offset into str to start reading the characters to be written.
len - The number of characters to be written.
Returns:
The number of characters written.
Throws:
Exception - If there is an error accessing the CLOB value or if pos is less than 0.

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.