Name

Clob

Synopsis

The Clob interface encapsulates a SQL CLOB (character large object) field. The interface actually contains a pointer to the CLOB within the database, rather than the complete character string. Data is retrieved via getAsciiStream(), which returns an InputStream, or via getCharacterStream(), which returns a Reader. The getSubString() method returns a specific substring within the CLOB, while the position() methods search the CLOB for a pattern and return the index of the pattern’s first appearance. JDBC 3.0 adds the setString(), setAsciiStream(), and setCharacterStream() methods, which allow JDBC applications to create and edit CLOB data in addition to reading it.

public interface Clob {
// Public Instance Methods
   public abstract java.io.InputStream getAsciiStream(
        ) throws SQLException;  
   public abstract Reader getCharacterStream(
        ) throws SQLException;  
   public abstract String getSubString(long pos, 
        int length) throws SQLException;  
   public abstract long length() throws SQLException;  
   public abstract long position(Clob searchstr, 
        long start) throws SQLException;  
   public abstract long position(String searchstr, 
        long start) throws SQLException;  
   public abstract java.io.OutputStream setAsciiStream(          // 1.4
        long pos) throws SQLException;  
   public abstract Writer setCharacterStream(                    // 1.4
        long pos) throws SQLException;  
   public abstract int setString(long pos,                       // 1.4
        String str) throws SQLException;  
   public abstract int setString(long pos, String str,           // 1.4
        int offset, int len) throws ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.