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) booleanWhether we have already freed resources.private InputStreamInputStream for operations that work that way.private longprivate StringReaderReader for the operations that work that way.private String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfree()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) longlength()longlongsetAsciiStream(long pos) setCharacterStream(long pos) intintvoidtruncate(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:
lengthin interfaceClob- Throws:
SQLException
-
truncate
- Specified by:
truncatein interfaceClob- Throws:
SQLException
-
getAsciiStream
- Specified by:
getAsciiStreamin interfaceClob- Throws:
SQLException
-
setAsciiStream
- Specified by:
setAsciiStreamin interfaceClob- Throws:
SQLException
-
getCharacterStream
- Specified by:
getCharacterStreamin interfaceClob- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin 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:
freein 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:
getCharacterStreamin 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:
getSubStringin interfaceClob- Throws:
SQLException
-
setString
- Specified by:
setStringin interfaceClob- Throws:
SQLException
-
setString
- Specified by:
setStringin interfaceClob- Throws:
SQLException
-
position
- Specified by:
positionin interfaceClob- Throws:
SQLException
-
position
- Specified by:
positionin interfaceClob- Throws:
SQLException
-