Class ClobImpl
java.lang.Object
org.datanucleus.store.rdbms.mapping.column.ClobImpl
- All Implemented Interfaces:
Clob
The mapping in the Java programming language for the SQL
CLOB
type.
An SQL CLOB
is a built-in type that stores a Character Large Object as a column value
in a row of a database table. By default drivers implement a Clob
object using an SQL
locator(CLOB)
, which means that a Clob
object contains a logical pointer to the
SQL CLOB
data rather than the data itself. A Clob
object is valid for the duration
of the transaction in which it was created.
The Clob
interface provides methods for getting the length of an SQL CLOB
(Character Large Object) value, for materializing a CLOB
value on the client, and for
searching for a substring or CLOB
object within a CLOB
value.
Methods in the interfaces ResultSet
, CallableStatement
, and PreparedStatement
, such as
getClob
and setClob
allow a programmer to access an SQL CLOB
value.
In addition, this interface has methods for updating a CLOB
value.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
Whether we have already freed resources.private InputStream
InputStream for operations that work that way.private long
private StringReader
Reader for the operations that work that way.private String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
free()
Free the Blob object and releases the resources that it holds.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.getSubString
(long pos, int length) long
length()
long
long
setAsciiStream
(long pos) setCharacterStream
(long pos) int
int
void
truncate
(long len)
-
Field Details
-
string
-
length
private long length -
reader
Reader for the operations that work that way. -
inputStream
InputStream for operations that work that way. TODO Rationalise with reader above. -
freed
boolean freedWhether we have already freed resources.
-
-
Constructor Details
-
ClobImpl
Constructor taking a string.- Parameters:
string
- The string.- Throws:
IOException
- if an error occurs
-
-
Method Details
-
length
- Specified by:
length
in interfaceClob
- Throws:
SQLException
-
truncate
- Specified by:
truncate
in interfaceClob
- Throws:
SQLException
-
getAsciiStream
- Specified by:
getAsciiStream
in interfaceClob
- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStream
in interfaceClob
- Throws:
SQLException
-
getCharacterStream
- Specified by:
getCharacterStream
in interfaceClob
- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStream
in interfaceClob
- Throws:
SQLException
-
free
Free the Blob object and releases the resources that it holds. The object is invalid once the free method is called.- Specified by:
free
in interfaceClob
- Throws:
SQLException
- if an error occurs
-
getCharacterStream
Returns a Reader object that contains a partial Clob value, starting with the character specified by pos, which is length characters in length.- Specified by:
getCharacterStream
in interfaceClob
- Parameters:
pos
- the offset to the first byte of the partial value to be retrieved. The first byte in the Clob is at position 1length
- the length in bytes of the partial value to be retrieved- Throws:
SQLException
-
getSubString
- Specified by:
getSubString
in interfaceClob
- Throws:
SQLException
-
setString
- Specified by:
setString
in interfaceClob
- Throws:
SQLException
-
setString
- Specified by:
setString
in interfaceClob
- Throws:
SQLException
-
position
- Specified by:
position
in interfaceClob
- Throws:
SQLException
-
position
- Specified by:
position
in interfaceClob
- Throws:
SQLException
-