Package org.apache.derby.impl.load
Class ImportClob
- java.lang.Object
-
- org.apache.derby.impl.load.ImportClob
-
- All Implemented Interfaces:
java.sql.Clob
class ImportClob extends java.lang.Object implements java.sql.Clob
This class implementsjava.sql.CLOB interface
. Objects created using theImportClob
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 satisfyjava.sql.Clob
interface.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
clobData
private long
clobLength
private long
length
private ImportLobFile
lobFile
private long
position
-
Constructor Summary
Constructors Constructor Description ImportClob(java.lang.String data)
Create a Clob object, whose value is given as string.ImportClob(ImportLobFile lobFile, long position, long length)
Create a import Clob object, that readslength
amount of data from an external file, starting atposition
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
free()
Raise error, not used by importjava.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()
ReturnsCLOB
value designated by thisClob
object as aReader
.java.io.Reader
getCharacterStream(long pos, long length)
Raise error, not used by importjava.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 thisCLOB
object.private java.sql.SQLException
methodNotImplemented()
Return an unimplemented feature errorlong
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.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.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.
-
-
-
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 readslength
amount of data from an external file, starting atposition
.- 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 thisCLOB
object.- Specified by:
length
in interfacejava.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
ReturnsCLOB
value designated by thisClob
object as aReader
.- Specified by:
getCharacterStream
in interfacejava.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 interfacejava.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 interfacejava.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 interfacejava.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 interfacejava.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 interfacejava.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 interfacejava.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 interfacejava.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 interfacejava.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 interfacejava.sql.Clob
- Throws:
java.sql.SQLException
- See Also:
Clob
-
getCharacterStream
public java.io.Reader getCharacterStream(long pos, long length) throws java.sql.SQLException
Raise error, not used by import- Specified by:
getCharacterStream
in interfacejava.sql.Clob
- Throws:
java.sql.SQLException
-
free
public void free() throws java.sql.SQLException
Raise error, not used by import- Specified by:
free
in interfacejava.sql.Clob
- Throws:
java.sql.SQLException
-
methodNotImplemented
private java.sql.SQLException methodNotImplemented()
Return an unimplemented feature error
-
-