O'Reilly logo

Database Programming with JDBC & Java, Second Edition by George Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Clob

Synopsis

Interface Name: java.sql.Clob

Superclass: None

Immediate Subclasses: None

Interfaces Implemented: None

Availability: New as of JDK 1.2

Description

A CLOB is an SQL3 type that stands for “character large object.” Like a BLOB, a CLOB represents a very large chunk of data in the database. Unlike a BLOB, it represents text stored using some sort of character encoding. The point of a CLOB type, as opposed to a CHAR or VARCHAR type, is that CLOB data, like BLOB data, can be retrieved as a stream instead of all at once.

Class Summary

public interface Clob {
    InputStream getAsciiStream( ) throws SQLException;
    Reader getCharacterStream( ) throws SQLException;
    String getSubString(long pos, int count) 
        throws SQLException;
    long length( ) throws SQLException;
    long position(String pattern, long start)
        throws SQLException;
    long position(Clob pattern, long start)
        throws SQLException;
}

Object Methods

getAsciiStream( )

public InputStream getAsciiStream( ) throws SQLException
Description

This method provides access to the data that makes up this Clob via an ASCII stream.

getCharacterStream( )

public Reader getCharacterStream( ) throws SQLException
Description

This method provides access to the data that makes up this Clob via a Unicode stream.

getSubString( )

public String getSubString(long pos, int count)
    throws SQLException
Description

This method returns a substring of the Clob starting at the named position up to the number of characters specified by the count value.

length( )

public long length( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required