java.io.Serializable
, java.sql.Clob
public class SQLServerClob
extends java.lang.Object
implements java.sql.Clob
Constructor | Description |
---|---|
SQLServerClob(SQLServerConnection connection,
java.lang.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.
|
java.io.InputStream |
getAsciiStream() |
Materialize the CLOB as an ASCII stream.
|
java.io.Reader |
getCharacterStream() |
Retrieves the CLOB value designated by this Clob object as a java.io.Reader object (or as a stream of characters).
|
java.io.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.
|
java.lang.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(java.lang.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.
|
long |
position(java.sql.Clob searchstr,
long start) |
Retrieves the character position at which the specified Clob object searchstr appears in this Clob object.
|
java.io.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.
|
java.io.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,
java.lang.String s) |
Writes the given Java String to the CLOB value that this Clob object designates at the position pos.
|
int |
setString(long pos,
java.lang.String str,
int offset,
int len) |
Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents.
|
java.lang.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, java.lang.String data)
SQLServerConnection.createClob()
instead.connection
- the database connection this blob is implemented ondata
- the CLOB's datapublic void free() throws java.sql.SQLException
free
in interface java.sql.Clob
java.sql.SQLException
- when an error occurspublic java.io.InputStream getAsciiStream() throws java.sql.SQLException
getAsciiStream
in interface java.sql.Clob
java.sql.SQLException
- when an error occurspublic java.io.Reader getCharacterStream() throws java.sql.SQLException
getCharacterStream
in interface java.sql.Clob
java.sql.SQLException
- if there is an error accessing the CLOB valuepublic java.io.Reader getCharacterStream(long pos, long length) throws java.sql.SQLException
getCharacterStream
in interface java.sql.Clob
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.java.sql.SQLException
- when an error occurs.public java.lang.String getSubString(long pos, int length) throws java.sql.SQLException
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 copied; the value for length must be 0 or greaterjava.sql.SQLException
- - if there is an error accessing the CLOB value; if pos is less than 1 or length is less than 0public long length() throws java.sql.SQLException
length
in interface java.sql.Clob
java.sql.SQLException
- when an error occurspublic long position(java.sql.Clob searchstr, long start) throws java.sql.SQLException
position
in interface java.sql.Clob
searchstr
- - the Clob 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 value or if start is less than 1public long position(java.lang.String searchstr, long start) throws java.sql.SQLException
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 value or if start is less than 1public void truncate(long len) throws java.sql.SQLException
truncate
in interface java.sql.Clob
len
- the length, in characters, to which the CLOB value should be truncatedjava.sql.SQLException
- when an error occurspublic java.io.OutputStream setAsciiStream(long pos) throws java.sql.SQLException
setAsciiStream
in interface java.sql.Clob
pos
- the position at which to start writing to this CLOB objectjava.sql.SQLException
- when an error occurspublic java.io.Writer setCharacterStream(long pos) throws java.sql.SQLException
setCharacterStream
in interface java.sql.Clob
pos
- the position at which to start writing to the CLOB valuejava.sql.SQLException
- when an error occurspublic int setString(long pos, java.lang.String s) throws java.sql.SQLException
setString
in interface java.sql.Clob
pos
- the position at which to start writing to the CLOBs
- the string to be written to the CLOB value that this Clob designatesjava.sql.SQLException
- when an error occurspublic int setString(long pos, java.lang.String str, int offset, int len) throws java.sql.SQLException
setString
in interface java.sql.Clob
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 writtenjava.sql.SQLException
- - if there is an error accessing the CLOB value or if pos is less than 1public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 Microsoft Corporation. All rights reserved.