public class MonetClob extends Object implements Clob, Serializable, Comparable<MonetClob>
Clob interface. Because
MonetDB/SQL currently has no support for streams, this class is a
shallow wrapper of a StringBuilder. It is more or less supplied to
enable an application that depends on it to run. It may be obvious
that it is a real resource expensive workaround that contradicts the
sole reason for a Clob: avoidance of huge resource consumption.
Use of this class is highly discouraged.| Constructor and Description |
|---|
MonetClob(char[] toParse,
int startPosition,
int count) |
MonetClob(String in) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(MonetClob o)
Adding the compare to method.
|
boolean |
equals(Object obj)
Overriding the equals method for the byte array.
|
void |
free()
This method frees the Clob object and releases the resources the resources that it holds.
|
InputStream |
getAsciiStream()
Retrieves the CLOB value designated by this Clob object as an ascii stream.
|
Reader |
getCharacterStream()
Retrieves the CLOB value designated by this Clob object as a java.io.Reader object
(or as a stream of characters).
|
Reader |
getCharacterStream(long pos,
long length)
Returns a Reader object that contains a partial Clob value, starting with the character specified by pos, which
is length characters in length.
|
String |
getSubString(long pos,
int length)
Retrieves a copy of the specified substring in the CLOB value designated by this Clob object.
|
int |
hashCode()
Overriding the hashCode method for the byte array.
|
long |
length()
Retrieves the number of characters in the CLOB value designated by this Clob object.
|
long |
position(Clob searchstr,
long start)
Retrieves the character position at which the specified Clob object searchstr appears in this Clob object.
|
long |
position(String searchstr,
long start)
Retrieves the character position at which the specified substring searchstr appears in the SQL CLOB value
represented by this Clob object.
|
OutputStream |
setAsciiStream(long pos) |
Writer |
setCharacterStream(long pos) |
int |
setString(long pos,
String str)
Writes the given Java 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.
|
String |
toString()
Returns the String behind this Clob.
|
void |
truncate(long len)
Truncates the CLOB value that this Clob designates to have a length of len characters.
|
public MonetClob(String in)
public MonetClob(char[] toParse,
int startPosition,
int count)
public void free()
public InputStream getAsciiStream() throws SQLException
getAsciiStream in interface ClobSQLException - if there is an error accessing the CLOB valuepublic Reader getCharacterStream() throws SQLException
getCharacterStream in interface ClobSQLException - if there is an error accessing the CLOB valuepublic Reader getCharacterStream(long pos, long length) throws SQLException
getCharacterStream in interface Clobpos - the offset to the first character of the partial value to be retrieved. The first character in the
Clob is at position 1.length - the length in characters of the partial value to be retrieved.SQLException - if there is an error accessing the CLOB valuepublic String getSubString(long pos, int length) throws SQLException
getSubString in interface Clobpos - the first character of the substring to be extracted. The first character is at position 1.length - the number of consecutive characters to be copiedSQLException - if there is an error accessing the CLOB valuepublic long length()
throws SQLException
length in interface ClobSQLException - if there is an error accessing the length of the CLOB valuepublic long position(Clob searchstr, long start) throws SQLException
position in interface Clobsearchstr - the Clob object for which to searchstart - the position at which to begin searching; the first position is 1SQLException - if there is an error accessing the CLOB valuepublic long position(String searchstr, long start) throws SQLException
position in interface Clobsearchstr - the substring for which to searchstart - the position at which to begin searching; the first position is 1SQLException - if there is an error accessing the CLOB valuepublic OutputStream setAsciiStream(long pos) throws SQLException
setAsciiStream in interface ClobSQLExceptionpublic Writer setCharacterStream(long pos) throws SQLException
setCharacterStream in interface ClobSQLExceptionpublic int setString(long pos,
String str)
throws SQLException
setString in interface Clobpos - the position at which to start writing to the CLOB value that this Clob object representsstr - the string to be written to the CLOB value that this Clob designatesSQLException - if there is an error accessing the CLOB valuepublic int setString(long pos,
String str,
int offset,
int len)
throws SQLException
setString in interface Clobpos - the position at which to start writing to this CLOB objectstr - the string to be written to the CLOB value that this Clob object representsoffset - the offset into str to start reading the characters to be writtenlen - the number of characters to be writtenSQLException - if there is an error accessing the CLOB valuepublic void truncate(long len)
throws SQLException
truncate in interface Cloblen - the length, in bytes, to which the CLOB value should be truncatedSQLException - if there is an error accessing the CLOB valuepublic String toString()
public boolean equals(Object obj)
public int hashCode()
public int compareTo(MonetClob o)
compareTo in interface Comparable<MonetClob>Copyright © 2017. All rights reserved.