public class SQLServerClob extends Object implements Clob
Constructor and Description |
---|
SQLServerClob(SQLServerConnection connection,
String data)
Deprecated.
Use
SQLServerConnection.createClob() instead. |
Modifier and Type | Method and Description |
---|---|
void |
free()
Frees this Clob/NClob object and releases the resources that it holds.
|
InputStream |
getAsciiStream()
Materialize the CLOB 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 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)
Retrieves a copy of the specified substring in the CLOB value designated by this Clob object.
|
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)
Retrieves 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)
Retrieves 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
free, getAsciiStream, getCharacterStream, getCharacterStream, getSubString, length, position, position, setAsciiStream, setCharacterStream, setString, setString, truncate
@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
SQLException
- when an error occurspublic InputStream getAsciiStream() throws SQLException
SQLException
- when an error occurspublic Reader getCharacterStream() throws SQLException
SQLException
- if there is an error accessing the CLOB valuepublic Reader getCharacterStream(long pos, long length) throws SQLException
pos
- 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
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; 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
SQLException
- when an error occurspublic long position(Clob searchstr, long start) throws SQLException
searchstr
- - 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
searchstr
- - 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
len
- the length, in characters, to which the CLOB value should be truncatedSQLException
- when an error occurspublic OutputStream setAsciiStream(long pos) throws SQLException
pos
- the position at which to start writing to this CLOB objectSQLException
- when an error occurspublic Writer setCharacterStream(long pos) throws SQLException
pos
- the position at which to start writing to the CLOB valueSQLException
- when an error occurspublic int setString(long pos, String s) throws SQLException
pos
- 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
pos
- - 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 © 2017 Microsoft Corporation. All rights reserved.