org.datanucleus.store.rdbms.datatype
Class ClobImpl

java.lang.Object
  extended by org.datanucleus.store.rdbms.datatype.ClobImpl
All Implemented Interfaces:
Clob

public class ClobImpl
extends Object
implements Clob

The mapping in the JavaTM 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.


Constructor Summary
ClobImpl(String string)
          Constructor taking a string.
 
Method Summary
 void free()
          Free the Blob object and releases the resources that it holds.
 InputStream getAsciiStream()
           
 Reader getCharacterStream()
           
 Reader 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.
 String getSubString(long pos, int length)
           
 long length()
           
 long position(Clob searchstr, long start)
           
 long position(String searchstr, long start)
           
 OutputStream setAsciiStream(long pos)
           
 Writer setCharacterStream(long pos)
           
 int setString(long pos, String str)
           
 int setString(long pos, String str, int offset, int len)
           
 void truncate(long len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClobImpl

public ClobImpl(String string)
         throws IOException
Constructor taking a string.

Parameters:
string - The string.
Throws:
IOException
Method Detail

length

public long length()
            throws SQLException
Specified by:
length in interface Clob
Throws:
SQLException

truncate

public void truncate(long len)
              throws SQLException
Specified by:
truncate in interface Clob
Throws:
SQLException

getAsciiStream

public InputStream getAsciiStream()
                           throws SQLException
Specified by:
getAsciiStream in interface Clob
Throws:
SQLException

setAsciiStream

public OutputStream setAsciiStream(long pos)
                            throws SQLException
Specified by:
setAsciiStream in interface Clob
Throws:
SQLException

getCharacterStream

public Reader getCharacterStream()
                          throws SQLException
Specified by:
getCharacterStream in interface Clob
Throws:
SQLException

setCharacterStream

public Writer setCharacterStream(long pos)
                          throws SQLException
Specified by:
setCharacterStream in interface Clob
Throws:
SQLException

free

public void free()
          throws SQLException
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 interface Clob
Throws:
SQLException

getCharacterStream

public Reader getCharacterStream(long pos,
                                 long length)
                          throws SQLException
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 interface Clob
Parameters:
pos - the offset to the first byte of the partial value to be retrieved. The first byte in the Clob is at position 1
length - the length in bytes of the partial value to be retrieved
Throws:
SQLException

getSubString

public String getSubString(long pos,
                           int length)
                    throws SQLException
Specified by:
getSubString in interface Clob
Throws:
SQLException

setString

public int setString(long pos,
                     String str)
              throws SQLException
Specified by:
setString in interface Clob
Throws:
SQLException

setString

public int setString(long pos,
                     String str,
                     int offset,
                     int len)
              throws SQLException
Specified by:
setString in interface Clob
Throws:
SQLException

position

public long position(String searchstr,
                     long start)
              throws SQLException
Specified by:
position in interface Clob
Throws:
SQLException

position

public long position(Clob searchstr,
                     long start)
              throws SQLException
Specified by:
position in interface Clob
Throws:
SQLException


Copyright © 2012. All Rights Reserved.