org.apache.derby.impl.load
Class ImportClob

java.lang.Object
  extended by org.apache.derby.impl.load.ImportClob
All Implemented Interfaces:
java.sql.Clob

 class ImportClob
extends java.lang.Object
implements java.sql.Clob

This class implements java.sql.CLOB interface . Objects created using the ImportClob class are intended to be be used to create a clob object of the data stored in an import file. Only the routines that are needed to read the clob data for the clob columns by the inserts done through the VTI have real implementations, Other routines are dummy ones to satisfy java.sql.Clob interface.


Field Summary
private  java.lang.String clobData
           
private  long clobLength
           
private  long length
           
private  ImportLobFile lobFile
           
private  long position
           
 
Constructor Summary
ImportClob(ImportLobFile lobFile, long position, long length)
          Create a import Clob object, that reads length amount of data from an external file, starting at position .
ImportClob(java.lang.String data)
          Create a Clob object, whose value is given as string.
 
Method Summary
 java.io.InputStream getAsciiStream()
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 java.io.Reader getCharacterStream()
          Returns CLOB value designated by this Clob object as a Reader .
 java.lang.String getSubString(long pos, int length)
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 long length()
          Returns the number of characters in this CLOB object.
 long position(java.sql.Clob searchstr, long start)
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 long position(java.lang.String searchstr, long start)
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 java.io.OutputStream setAsciiStream(long pos)
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 java.io.Writer setCharacterStream(long pos)
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 int setString(long pos, java.lang.String str)
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 int setString(long pos, java.lang.String str, int offset, int len)
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 void truncate(long len)
          This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Clob
free, getCharacterStream
 

Field Detail

lobFile

private ImportLobFile lobFile

position

private long position

length

private long length

clobLength

private long clobLength

clobData

private java.lang.String clobData
Constructor Detail

ImportClob

public ImportClob(ImportLobFile lobFile,
                  long position,
                  long length)
           throws java.io.IOException
Create a import Clob object, that reads length amount of data from an external file, starting at position .

Parameters:
lobFile - lob file resource object, using which data is read.
position - byte offset in the file, of this clob column data.
length - length of this clob object data in bytes.
Throws:
java.io.IOException

ImportClob

public ImportClob(java.lang.String data)
Create a Clob object, whose value is given as string.

Parameters:
data - String that contains the clob data.
Method Detail

length

public long length()
            throws java.sql.SQLException
Returns the number of characters in this CLOB object.

Specified by:
length in interface java.sql.Clob
Returns:
length of the CLOB in characters
Throws:
java.sql.SQLException - on any error.

getCharacterStream

public java.io.Reader getCharacterStream()
                                  throws java.sql.SQLException
Returns CLOB value designated by this Clob object as a Reader .

Specified by:
getCharacterStream in interface java.sql.Clob
Returns:
a Reader containing the CLOB data.
Throws:
java.sql.SQLException - if any error occurs while setting up this clob data in the import file as Reader.
See Also:
Clob

getSubString

public java.lang.String getSubString(long pos,
                                     int length)
                              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
getSubString in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

getAsciiStream

public java.io.InputStream getAsciiStream()
                                   throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
getAsciiStream in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

position

public long position(java.lang.String searchstr,
                     long start)
              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
position in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

position

public long position(java.sql.Clob searchstr,
                     long start)
              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
position in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

setString

public int setString(long pos,
                     java.lang.String str)
              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
setString in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

setString

public int setString(long pos,
                     java.lang.String str,
                     int offset,
                     int len)
              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
setString in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

setAsciiStream

public java.io.OutputStream setAsciiStream(long pos)
                                    throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
setAsciiStream in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

setCharacterStream

public java.io.Writer setCharacterStream(long pos)
                                  throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
setCharacterStream in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

truncate

public void truncate(long len)
              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.

Specified by:
truncate in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.