-
- All Superinterfaces:
java.lang.AutoCloseable
public interface SqlClob extends java.lang.AutoCloseable
A reference to a CHARACTER LARGE OBJECT in the attached database.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Operation<java.lang.Void>
closeOperation()
Return anOperation
that will release the temporary resources associated with thisSqlClob
.default java.util.concurrent.CompletionStage<java.lang.Long>
getPosition()
Get the position of thisSqlClob
.Operation<java.lang.Long>
getPositionOperation()
Return aOperation
that fetches the position of thisSqlClob
.java.io.Reader
getReader()
Returns aReader
for the characters in thisSqlClob
.java.io.Writer
getWriter()
Returns a Writer for thisSqlClob
.default java.util.concurrent.CompletionStage<java.lang.Long>
length()
Get the length of thisSqlClob
.Operation<java.lang.Long>
lengthOperation()
Return aOperation
that fetches the length of thisSqlClob
.default SqlClob
locate(java.lang.CharSequence target)
Set the position to the beginning of the next occurrence of the target after the position.default SqlClob
locate(SqlClob target)
Set the position to the beginning of the next occurrence of the target after the position.Operation<java.lang.Long>
locateOperation(java.lang.CharSequence target)
Return anOperation
to set the position to the beginning of the next occurrence of the target after the position.Operation<java.lang.Long>
locateOperation(SqlClob target)
Return anOperation
to set the position to the beginning of the next occurrence of the target after the position.default SqlClob
setPosition(long offset)
Set the position of thisSqlClob
.Operation<java.lang.Long>
setPositionOperation(long offset)
Return anOperation
that sets the position of thisSqlClob
.default SqlClob
trim()
Truncate thisSqlClob
so that the current position is the end of theSqlClob
.Operation<java.lang.Long>
trimOperation()
Return anOperation
that truncates thisSqlClob
so that the current position is the end of theSqlClob
.
-
-
-
Method Detail
-
closeOperation
Operation<java.lang.Void> closeOperation()
Return anOperation
that will release the temporary resources associated with thisSqlClob
.- Returns:
- an
Operation
that will release the temporary resources associated with thisSqlClob
.
-
close
default void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
getPositionOperation
Operation<java.lang.Long> getPositionOperation()
-
getPosition
default java.util.concurrent.CompletionStage<java.lang.Long> getPosition()
Get the position of thisSqlClob
. Position 0 is immediately before the first char in theSqlClob
. Position 1 is the first char in theSqlClob
, etc. Positionlength()
is the last char in the SqlClob. Position is between 0 and length + 1. ISSUE: Should position be 1-based as SQL seems to do or 0-based as Java does?- Returns:
- a future which value is the position of this
SqlClob
- Throws:
java.lang.IllegalStateException
- if theSession
that created thisSqlClob
is closed.
-
lengthOperation
Operation<java.lang.Long> lengthOperation()
Return aOperation
that fetches the length of thisSqlClob
.
-
length
default java.util.concurrent.CompletionStage<java.lang.Long> length()
Get the length of thisSqlClob
.- Returns:
- a
Future
which value is the number of chars in thisSqlClob
- Throws:
java.lang.IllegalStateException
- if theSession
that created thisSqlClob
is closed.
-
setPositionOperation
Operation<java.lang.Long> setPositionOperation(long offset)
Return anOperation
that sets the position of thisSqlClob
. Ifoffset
exceeds the length of thisSqlClob
set position to the length + 1 of thisSqlClob
, ie one past the last char.
-
setPosition
default SqlClob setPosition(long offset)
Set the position of thisSqlClob
. Ifoffset
exceeds the length of thisSqlClob
set position to the length + 1 of thisSqlClob
, ie one past the last char.- Parameters:
offset
- the 1-based position to set- Returns:
- this
SqlClob
- Throws:
java.lang.IllegalArgumentException
- ifoffset
is less than 0java.lang.IllegalStateException
- if theSession
that created thisSqlClob
is closed.
-
locateOperation
Operation<java.lang.Long> locateOperation(SqlClob target)
Return anOperation
to set the position to the beginning of the next occurrence of the target after the position. If there is no such occurrence set the position to 0.- Parameters:
target
- aSqlClob
created by the sameSession
containing the char sequence to search for- Returns:
- an
Operation
that locatestarget
in thisSqlClob
- Throws:
java.lang.IllegalArgumentException
- iftarget
was created by some otherSession
java.lang.IllegalStateException
- if theSession
that created thisSqlClob
is closed.
-
locate
default SqlClob locate(SqlClob target)
Set the position to the beginning of the next occurrence of the target after the position. If there is no such occurrence set the position to 0.
-
locateOperation
Operation<java.lang.Long> locateOperation(java.lang.CharSequence target)
Return anOperation
to set the position to the beginning of the next occurrence of the target after the position. If there is no such occurrence set the position to 0.
-
locate
default SqlClob locate(java.lang.CharSequence target)
Set the position to the beginning of the next occurrence of the target after the position. If there is no such occurrence set the position to 0.- Parameters:
target
- the char sequence to search for- Returns:
- this
SqlClob
- Throws:
java.lang.IllegalStateException
- if theSession
that created thisSqlClob
is closed.
-
trimOperation
Operation<java.lang.Long> trimOperation()
Return anOperation
that truncates thisSqlClob
so that the current position is the end of theSqlClob
. If the position is N, then after trim() the length is N - 1. The position is still N. This will fail if position is 0.
-
trim
default SqlClob trim()
Truncate thisSqlClob
so that the current position is the end of theSqlClob
. If the position is N, then aftertrim()
the length is N - 1. The position is still N. This will fail if position is 0.- Returns:
- this
SqlClob
- Throws:
java.lang.IllegalStateException
- if theSession
that created thisSqlClob
is closed or position is 0.
-
getReader
java.io.Reader getReader()
Returns aReader
for the characters in thisSqlClob
. Characters are read starting at the current position. Each character read advances the position by one. ISSUE: There is no character analog toAsynchronousByteChannel
. It is trivial to construct aReader
from anAsynchronousByteChannel
however.- Returns:
- a Reader for the characters in this SqlClob
-
getWriter
java.io.Writer getWriter()
Returns a Writer for thisSqlClob
. Characters are written starting at the current position. Each character written advances the position by one. ISSUE: There is no character analog toAsynchronousByteChannel
. It is trivial to construct aWriter
from anAsynchronousByteChannel
however.- Returns:
- a
Writer
for the characters of thisSqlClob
-
-