Serializable, Clobpublic class SQLServerClob extends Object implements Clob
| Constructor | Description |
|---|---|
SQLServerClob(SQLServerConnection connection,
String data) |
Deprecated.
Use
SQLServerConnection.createClob() instead. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
free() |
Frees this Clob/NClob object and releases the resources that it holds.
|
InputStream |
getAsciiStream() |
Returns the CLOB as an ASCII stream.
|
Reader |
getCharacterStream() |
Returns 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 the Clob data as a java.io.Reader object or as a stream of characters with the specified position and
length.
|
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(String searchstr,
long start) |
Returns the character position at which the specified substring searchstr appears in the SQL CLOB value
represented by this Clob object.
|
long |
position(Clob searchstr,
long start) |
Returns the character position at which the specified Clob object searchstr appears in this Clob object.
|
OutputStream |
setAsciiStream(long pos) |
Returns a stream to be used to write Ascii characters to the CLOB value that this Clob object represents,
starting at position pos.
|
Writer |
setCharacterStream(long pos) |
Returns a stream to be used to write a stream of Unicode characters to the CLOB value that this Clob object
represents, at position pos.
|
int |
setString(long pos,
String s) |
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() |
|
void |
truncate(long len) |
Truncates the CLOB value that this Clob designates to have a length of len characters.
|
@Deprecated public SQLServerClob(SQLServerConnection connection, String data)
SQLServerConnection.createClob() instead.connection - the database connection this blob is implemented ondata - the CLOB's datapublic void free()
throws SQLException
free in interface ClobSQLException - when an error occurspublic InputStream getAsciiStream() throws SQLException
getAsciiStream in interface ClobSQLException - when an error occurspublic 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 - A long that indicates the offset to the first character of the partial value to be retrieved.length - A long that indicates the length in characters of the partial value to be retrieved.SQLException - when an error occurs.public 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 copied; the value for length must be 0 or greaterSQLException - - if there is an error accessing the CLOB value; if pos is less than 1 or length is less than 0public long length()
throws SQLException
length in interface ClobSQLException - when an error occurspublic long position(Clob searchstr, long start) throws SQLException
position in interface Clobsearchstr - - the Clob for which to searchstart - - the position at which to begin searching; the first position is 1SQLException - - if there is an error accessing the CLOB value or if start is less than 1public 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 value or if start is less than 1public void truncate(long len)
throws SQLException
truncate in interface Cloblen - the length, in characters, to which the CLOB value should be truncatedSQLException - when an error occurspublic OutputStream setAsciiStream(long pos) throws SQLException
setAsciiStream in interface Clobpos - the position at which to start writing to this CLOB objectSQLException - when an error occurspublic Writer setCharacterStream(long pos) throws SQLException
setCharacterStream in interface Clobpos - the position at which to start writing to the CLOB valueSQLException - when an error occurspublic int setString(long pos,
String s)
throws SQLException
setString in interface Clobpos - the position at which to start writing to the CLOBs - the string to be written to the CLOB value that this Clob designatesSQLException - when an error occurspublic 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 object; The first position is 1str - - the string to be written to the CLOB value that this Clob object representsoffset - - the offset (0-based) 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 value or if pos is less than 1Copyright © 2018 Microsoft Corporation. All rights reserved.