Top Description Fields Constructors Methods
org.apache.derby.impl.load

pack-priv Class ImportClob

extends Object
implements Clob
Class Inheritance
All Implemented Interfaces
java.sql.Clob
Imports
org.apache.derby.iapi.services.io.LimitReader, java.sql.Clob, .SQLException, java.io.Reader, .IOException

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

Modifier and TypeField and Description
private String
private long
private long
private ImportLobFile
private long

Constructor Summary

AccessConstructor and Description
public
ImportClob(ImportLobFile
lob file resource object, using which data is read.
lobFile
,
long
byte offset in the file, of this clob column data.
position
,
long
length of this clob object data in bytes.
length
)

Create a import Clob object, that reads length amount of data from an external file, starting at position .

public
ImportClob(String
String that contains the clob data.
data
)

Create a Clob object, whose value is given as string.

Method Summary

Modifier and TypeMethod and Description
public void
free()

Implements java.sql.Clob.free.

Raise error, not used by import

public InputStream
getAsciiStream()

Implements java.sql.Clob.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.

public Reader

Returns:

a Reader containing the CLOB data.
getCharacterStream
()

Implements java.sql.Clob.getCharacterStream.

Returns CLOB value designated by this Clob object as a Reader .

public Reader
getCharacterStream(long
the offset to the first character of the partial value to be retrieved. The first character in the Clob is at position 1.
pos
,
long
the length in characters of the partial value to be retrieved.
length
)

Implements java.sql.Clob.getCharacterStream.

Raise error, not used by import

public String
getSubString(long
the first character of the substring to be extracted. The first character is at position 1.
pos
,
int
the number of consecutive characters to be copied; the value for length must be 0 or greater
length
)

Implements java.sql.Clob.getSubString.

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.

public long

Returns:

length of the CLOB in characters
length
()

Implements java.sql.Clob.length.

Returns the number of characters in this CLOB object.

private SQLException
methodNotImplemented()

Return an unimplemented feature error

public long
position(String
the substring for which to search
searchstr
,
long
the position at which to begin searching; the first position is 1
start
)

Implements java.sql.Clob.position.

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.

public long
position(Clob
the Clob object for which to search
searchstr
,
long
the position at which to begin searching; the first position is 1
start
)

Implements java.sql.Clob.position.

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.

public OutputStream
setAsciiStream(long
the position at which to start writing to this CLOB object; The first position is 1
pos
)

Implements java.sql.Clob.setAsciiStream.

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.

public Writer
setCharacterStream(long
the position at which to start writing to the CLOB value; The first position is 1
pos
)

Implements java.sql.Clob.setCharacterStream.

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.

public int
setString(long
the position at which to start writing to the CLOB value that this Clob object represents; the first position is 1.
pos
,
String
the string to be written to the CLOB value that this Clob designates
str
)

Implements java.sql.Clob.setString.

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.

public int
setString(long
the position at which to start writing to this CLOB object; The first position is 1
pos
,
String
the string to be written to the CLOB value that this Clob object represents
str
,
int
the offset into str to start reading the characters to be written
offset
,
int
the number of characters to be written
len
)

Implements java.sql.Clob.setString.

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.

public void
truncate(long
the length, in characters, to which the CLOB value should be truncated
len
)

Implements java.sql.Clob.truncate.

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clobDataback to summary
private String clobData
clobLengthback to summary
private long clobLength
lengthback to summary
private long length
lobFileback to summary
private ImportLobFile lobFile
positionback to summary
private long position

Constructor Detail

ImportClobback to summary
public ImportClob(ImportLobFile lobFile, long position, long length) throws IOException

Create a import Clob object, that reads length amount of data from an external file, starting at position .

Parameters
lobFile:ImportLobFile

lob file resource object, using which data is read.

position:long

byte offset in the file, of this clob column data.

length:long

length of this clob object data in bytes.

ImportClobback to summary
public ImportClob(String data)

Create a Clob object, whose value is given as string.

Parameters
data:String

String that contains the clob data.

Method Detail

freeback to summary
public void free() throws SQLException

Implements java.sql.Clob.free.

Raise error, not used by import

Exceptions
SQLException:

Doc from java.sql.Clob.free.

if an error occurs releasing the Clob's resources

getAsciiStreamback to summary
public InputStream getAsciiStream() throws SQLException

Implements java.sql.Clob.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.

Returns:InputStream

Doc from java.sql.Clob.getAsciiStream.

a java.io.InputStream object containing the CLOB data

Exceptions
SQLException:

Doc from java.sql.Clob.getAsciiStream.

if there is an error accessing the CLOB value

See Also
java.sql.Clob
getCharacterStreamback to summary
public Reader getCharacterStream() throws SQLException

Implements java.sql.Clob.getCharacterStream.

Returns CLOB value designated by this Clob object as a Reader .

Returns:Reader

a Reader containing the CLOB data.

Exceptions
SQLException:
if any error occurs while setting up this clob data in the import file as Reader.
See Also
java.sql.Clob
getCharacterStreamback to summary
public Reader getCharacterStream(long pos, long length) throws SQLException

Implements java.sql.Clob.getCharacterStream.

Raise error, not used by import

Parameters
pos:long

Doc from java.sql.Clob.getCharacterStream.

the offset to the first character of the partial value to be retrieved. The first character in the Clob is at position 1.

length:long

Doc from java.sql.Clob.getCharacterStream.

the length in characters of the partial value to be retrieved.

Returns:Reader

Doc from java.sql.Clob.getCharacterStream.

Reader through which the partial Clob value can be read.

Exceptions
SQLException:

Doc from java.sql.Clob.getCharacterStream.

if pos is less than 1; or if pos is greater than the number of characters in the Clob; or if pos + length is greater than the number of characters in the Clob

getSubStringback to summary
public String getSubString(long pos, int length) throws SQLException

Implements java.sql.Clob.getSubString.

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.

Parameters
pos:long

Doc from java.sql.Clob.getSubString.

the first character of the substring to be extracted. The first character is at position 1.

length:int

Doc from java.sql.Clob.getSubString.

the number of consecutive characters to be copied; the value for length must be 0 or greater

Returns:String

Doc from java.sql.Clob.getSubString.

a String that is the specified substring in the CLOB value designated by this Clob object

Exceptions
SQLException:

Doc from java.sql.Clob.getSubString.

if there is an error accessing the CLOB value; if pos is less than 1 or length is less than 0

See Also
java.sql.Clob
lengthback to summary
public long length() throws SQLException

Implements java.sql.Clob.length.

Returns the number of characters in this CLOB object.

Returns:long

length of the CLOB in characters

Exceptions
SQLException:
on any error.
methodNotImplementedback to summary
private SQLException methodNotImplemented()

Return an unimplemented feature error

positionback to summary
public long position(String searchstr, long start) throws SQLException

Implements java.sql.Clob.position.

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.

Parameters
searchstr:String

Doc from java.sql.Clob.position.

the substring for which to search

start:long

Doc from java.sql.Clob.position.

the position at which to begin searching; the first position is 1

Returns:long

Doc from java.sql.Clob.position.

the position at which the substring appears or -1 if it is not present; the first position is 1

Exceptions
SQLException:

Doc from java.sql.Clob.position.

if there is an error accessing the CLOB value or if pos is less than 1

See Also
java.sql.Clob
positionback to summary
public long position(Clob searchstr, long start) throws SQLException

Implements java.sql.Clob.position.

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.

Parameters
searchstr:Clob

Doc from java.sql.Clob.position.

the Clob object for which to search

start:long

Doc from java.sql.Clob.position.

the position at which to begin searching; the first position is 1

Returns:long

Doc from java.sql.Clob.position.

the position at which the Clob object appears or -1 if it is not present; the first position is 1

Exceptions
SQLException:

Doc from java.sql.Clob.position.

if there is an error accessing the CLOB value or if start is less than 1

See Also
java.sql.Clob
setAsciiStreamback to summary
public OutputStream setAsciiStream(long pos) throws SQLException

Implements java.sql.Clob.setAsciiStream.

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.

Parameters
pos:long

Doc from java.sql.Clob.setAsciiStream.

the position at which to start writing to this CLOB object; The first position is 1

Returns:OutputStream

Doc from java.sql.Clob.setAsciiStream.

the stream to which ASCII encoded characters can be written

Exceptions
SQLException:

Doc from java.sql.Clob.setAsciiStream.

if there is an error accessing the CLOB value or if pos is less than 1

See Also
java.sql.Clob
setCharacterStreamback to summary
public Writer setCharacterStream(long pos) throws SQLException

Implements java.sql.Clob.setCharacterStream.

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.

Parameters
pos:long

Doc from java.sql.Clob.setCharacterStream.

the position at which to start writing to the CLOB value; The first position is 1

Returns:Writer

Doc from java.sql.Clob.setCharacterStream.

a stream to which Unicode encoded characters can be written

Exceptions
SQLException:

Doc from java.sql.Clob.setCharacterStream.

if there is an error accessing the CLOB value or if pos is less than 1

See Also
java.sql.Clob
setStringback to summary
public int setString(long pos, String str) throws SQLException

Implements java.sql.Clob.setString.

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.

Parameters
pos:long

Doc from java.sql.Clob.setString.

the position at which to start writing to the CLOB value that this Clob object represents; the first position is 1.

str:String

Doc from java.sql.Clob.setString.

the string to be written to the CLOB value that this Clob designates

Returns:int

Doc from java.sql.Clob.setString.

the number of characters written

Exceptions
SQLException:

Doc from java.sql.Clob.setString.

if there is an error accessing the CLOB value or if pos is less than 1

See Also
java.sql.Clob
setStringback to summary
public int setString(long pos, String str, int offset, int len) throws SQLException

Implements java.sql.Clob.setString.

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.

Parameters
pos:long

Doc from java.sql.Clob.setString.

the position at which to start writing to this CLOB object; The first position is 1

str:String

Doc from java.sql.Clob.setString.

the string to be written to the CLOB value that this Clob object represents

offset:int

Doc from java.sql.Clob.setString.

the offset into str to start reading the characters to be written

len:int

Doc from java.sql.Clob.setString.

the number of characters to be written

Returns:int

Doc from java.sql.Clob.setString.

the number of characters written

Exceptions
SQLException:

Doc from java.sql.Clob.setString.

if there is an error accessing the CLOB value or if pos is less than 1

See Also
java.sql.Clob
truncateback to summary
public void truncate(long len) throws SQLException

Implements java.sql.Clob.truncate.

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.

Parameters
len:long

Doc from java.sql.Clob.truncate.

the length, in characters, to which the CLOB value should be truncated

Exceptions
SQLException:

Doc from java.sql.Clob.truncate.

if there is an error accessing the CLOB value or if len is less than 0

See Also
java.sql.Clob