public class FBClob
extends java.lang.Object
implements java.sql.Clob, java.sql.NClob
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.
This class also implements NClob
so it can be used with the set/get/updateNClob
methods
transparently. It technically does not conform to the JDBC requirements for NClob
.
Modifier and Type | Method and Description |
---|---|
void |
copyCharacterStream(java.io.Reader characterStream) |
void |
copyCharacterStream(java.io.Reader characterStream,
long length)
Copy data from a character stream into this Blob.
|
void |
free() |
java.io.InputStream |
getAsciiStream()
Gets the
CLOB value designated by this Clob
object as a stream of Ascii bytes. |
java.io.Reader |
getCharacterStream()
Gets the
CLOB value designated by this Clob
object as a Unicode stream. |
java.io.Reader |
getCharacterStream(long pos,
long length) |
java.lang.String |
getSubString(long pos,
int length)
Returns a copy of the specified substring in the
CLOB
value designated by this Clob object. |
FBBlob |
getWrappedBlob()
Retrieves the FBBlob wrapped by this FBClob.
|
long |
length()
Returns the number of characters in the
CLOB value
designated by this Clob object. |
long |
position(java.sql.Clob searchstr,
long start)
Determines the character position at which the specified
Clob object searchstr appears in this
Clob object. |
long |
position(java.lang.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. |
java.io.OutputStream |
setAsciiStream(long pos)
Set a byte stream to write the contents of this Clob.
|
java.io.Writer |
setCharacterStream(long position)
Create a writer to add character data to this Clob.
|
int |
setString(long pos,
java.lang.String str) |
int |
setString(long pos,
java.lang.String str,
int offset,
int len) |
void |
truncate(long param1)
This operation is not currently supported Truncate this
Clob to a given length. |
public FBClob(FBBlob blob)
public long length() throws java.sql.SQLException
CLOB
value
designated by this Clob
object.length
in interface java.sql.Clob
CLOB
in charactersjava.sql.SQLException
- if there is an error accessing the length of the
CLOB
public void truncate(long param1) throws java.sql.SQLException
Clob
to a given length.truncate
in interface java.sql.Clob
param1
- The length to truncate this Clob tojava.sql.SQLException
- this operation is not supportedpublic java.lang.String getSubString(long pos, int length) throws java.sql.SQLException
CLOB
value designated by this Clob
object. The substring begins
at position pos
and has up to length
consecutive characters.getSubString
in interface java.sql.Clob
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 copiedString
that is the specified substring in the
CLOB
value designated by this Clob
objectjava.sql.SQLException
- if there is an error accessing the CLOB
public java.io.Reader getCharacterStream() throws java.sql.SQLException
CLOB
value designated by this Clob
object as a Unicode stream.getCharacterStream
in interface java.sql.Clob
CLOB
datajava.sql.SQLException
- if there is an error accessing the CLOB
valuepublic java.io.InputStream getAsciiStream() throws java.sql.SQLException
CLOB
value designated by this Clob
object as a stream of Ascii bytes.getAsciiStream
in interface java.sql.Clob
CLOB
datajava.sql.SQLException
- if there is an error accessing the CLOB
valuepublic long position(java.lang.String searchstr, long start) throws java.sql.SQLException
searchstr
appears in the SQL CLOB
value
represented by this Clob
object. The search begins at
position start
.position
in interface java.sql.Clob
searchstr
- the substring for which to searchstart
- the position at which to begin searching; the first position
is 1java.sql.SQLException
- if there is an error accessing the CLOB
valuepublic long position(java.sql.Clob searchstr, long start) throws java.sql.SQLException
Clob
object searchstr
appears in this
Clob
object. The search begins at position
start
.position
in interface java.sql.Clob
searchstr
- the Clob
object for which to searchstart
- the position at which to begin searching; the first position
is 1Clob
object appears,
else -1; the first position is 1java.sql.SQLException
- if there is an error accessing the CLOB
valuepublic int setString(long pos, java.lang.String str) throws java.sql.SQLException
Jaybird currently does not support this method.
setString
in interface java.sql.Clob
java.sql.SQLException
public int setString(long pos, java.lang.String str, int offset, int len) throws java.sql.SQLException
Jaybird currently does not support this method.
setString
in interface java.sql.Clob
java.sql.SQLException
public java.io.OutputStream setAsciiStream(long pos) throws java.sql.SQLException
setAsciiStream
in interface java.sql.Clob
pos
- The position at which writing is to start.java.sql.SQLException
- public java.io.Writer setCharacterStream(long position) throws java.sql.SQLException
setCharacterStream
in interface java.sql.Clob
position
- The position at which the Writer should start writingjava.sql.SQLException
- public void free() throws java.sql.SQLException
free
in interface java.sql.Clob
java.sql.SQLException
public java.io.Reader getCharacterStream(long pos, long length) throws java.sql.SQLException
getCharacterStream
in interface java.sql.Clob
java.sql.SQLException
public void copyCharacterStream(java.io.Reader characterStream, long length) throws java.sql.SQLException
Calling with length -1
is equivalent to calling copyCharacterStream(Reader)
.
characterStream
- the source of data to copylength
- The maximum number of bytes to copy, or -1
to read the whole streamjava.sql.SQLException
public void copyCharacterStream(java.io.Reader characterStream) throws java.sql.SQLException
java.sql.SQLException
public FBBlob getWrappedBlob() throws java.sql.SQLException
java.sql.SQLException
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.