org.firebirdsql.jdbc

Class FBClob

Implemented Interfaces:
Clob

public class FBClob
extends java.lang.Object
implements Clob

The mapping in the JavaTM programming language for the SQL CLOB type. An SQL CLOB is a built-in type that stores a Character Large Object as a column value in a row of a database table. CLOBS are not currently supported by the Jaybird driver. The Clob interface provides methods for getting the length of an SQL CLOB (Character Large Object) value, for materializing a CLOB value on the client, and for searching for a substring or CLOB object within a CLOB value. Methods in the interfaces ResultSet, CallableStatement, and PreparedStatement, such as getClob and setClob allow a programmer to access an SQL CLOB value. In addition, this interface has methods for updating a CLOB value.
Version:
1.0
Author:
David Jencks

Method Summary

InputStream
getAsciiStream()
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
Reader
getCharacterStream()
Gets the CLOB value designated by this Clob object as a Unicode stream.
String
getSubString(long pos, int length)
Returns a copy of the specified substring in the CLOB value designated by this Clob object.
long
length()
Returns the number of characters in the CLOB value designated by this Clob object.
long
position(Clob searchstr, long start)
Determines the character position at which the specified Clob object searchstr appears in this Clob object.
long
position(String searchstr, long start)
Determines the character position at which the specified substring searchstr appears in the SQL CLOB value represented by this Clob object.
OutputStream
setAsciiStream(long param1)
This operation is not supported
Writer
setCharacterStream(long param1)
This operation is not supported
int
setString(long param1, String param2)
This operation is not supported Writes the given Java String to the CLOB value that this Clob object designates at the position pos.
int
setString(long param1, String param2, int param3, int param4)
This operation is not supported
void
truncate(long param1)
This operation is not currently supported Truncate this Clob to a given length.

Method Details

getAsciiStream

public InputStream getAsciiStream()
            throws SQLException
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
Returns:
an ascii stream containing the CLOB data
Since:
1.2

getCharacterStream

public Reader getCharacterStream()
            throws SQLException
Gets the CLOB value designated by this Clob object as a Unicode stream.
Returns:
a Unicode stream containing the CLOB data
Since:
1.2

getSubString

public String getSubString(long pos,
                           int length)
            throws SQLException
Returns 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 1.
length - the number of consecutive characters to be copied
Returns:
a String that is the specified substring in the CLOB value designated by this Clob object
Since:
1.2

length

public long length()
            throws SQLException
Returns the number of characters in the CLOB value designated by this Clob object.
Returns:
length of the CLOB in characters
Since:
1.2

position

public long position(Clob searchstr,
                     long start)
            throws SQLException
Determines the character position at which the specified Clob object searchstr appears in this Clob object. The search begins at position start.
Parameters:
searchstr - the Clob object for which to search
start - the position at which to begin searching; the first position is 1
Returns:
the position at which the Clob object appears, else -1; the first position is 1
Since:
1.2

position

public long position(String searchstr,
                     long start)
            throws SQLException
Determines the character position at which the specified substring searchstr appears in the SQL CLOB value represented by this Clob object. The search begins at position start.
Parameters:
searchstr - the substring for which to search
start - the position at which to begin searching; the first position is 1
Returns:
the position at which the substring appears, else -1; the first position is 1
Since:
1.2

setAsciiStream

public OutputStream setAsciiStream(long param1)
            throws SQLException
This operation is not supported
Parameters:
param1 -
Returns:

setCharacterStream

public Writer setCharacterStream(long param1)
            throws SQLException
This operation is not supported
Parameters:
param1 -
Returns:

setString

public int setString(long param1,
                     String param2)
            throws SQLException
This operation is not supported Writes the given Java String to the CLOB value that this Clob object designates at the position pos.
Parameters:
param1 - position at which to start writing
param2 - The String value to write
Returns:
The number of characters written

setString

public int setString(long param1,
                     String param2,
                     int param3,
                     int param4)
            throws SQLException
This operation is not supported
Parameters:
param1 -
param2 -
param3 -
param4 -
Returns:

truncate

public void truncate(long param1)
            throws SQLException
This operation is not currently supported Truncate this Clob to a given length.
Parameters:
param1 - The length to truncate this Clob to

Copyright B) 2001 David Jencks and other authors. All rights reserved.