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.ClobThis class implementsjava.sql.CLOB interface. Objects created using theImportClobclass 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.Clobinterface.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringclobDataprivate longclobLengthprivate longlengthprivate ImportLobFilelobFileprivate longposition
-
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 readslengthamount of data from an external file, starting atposition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfree()Raise error, not used by importjava.io.InputStreamgetAsciiStream()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.ReadergetCharacterStream()ReturnsCLOBvalue designated by thisClobobject as aReader.java.io.ReadergetCharacterStream(long pos, long length)Raise error, not used by importjava.lang.StringgetSubString(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.longlength()Returns the number of characters in thisCLOBobject.private java.sql.SQLExceptionmethodNotImplemented()Return an unimplemented feature errorlongposition(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.longposition(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.OutputStreamsetAsciiStream(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.WritersetCharacterStream(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.intsetString(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.intsetString(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.voidtruncate(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 readslengthamount 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.SQLExceptionReturns the number of characters in thisCLOBobject.- Specified by:
lengthin interfacejava.sql.Clob- Returns:
- length of the
CLOBin characters - Throws:
java.sql.SQLException- on any error.
-
getCharacterStream
public java.io.Reader getCharacterStream() throws java.sql.SQLExceptionReturnsCLOBvalue designated by thisClobobject as aReader.- Specified by:
getCharacterStreamin interfacejava.sql.Clob- Returns:
- a Reader containing the
CLOBdata. - 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.SQLExceptionThis 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:
getSubStringin interfacejava.sql.Clob- Throws:
java.sql.SQLException- See Also:
Clob
-
getAsciiStream
public java.io.InputStream getAsciiStream() throws java.sql.SQLExceptionThis 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:
getAsciiStreamin interfacejava.sql.Clob- Throws:
java.sql.SQLException- See Also:
Clob
-
position
public long position(java.lang.String searchstr, long start) throws java.sql.SQLExceptionThis 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:
positionin interfacejava.sql.Clob- Throws:
java.sql.SQLException- See Also:
Clob
-
position
public long position(java.sql.Clob searchstr, long start) throws java.sql.SQLExceptionThis 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:
positionin interfacejava.sql.Clob- Throws:
java.sql.SQLException- See Also:
Clob
-
setString
public int setString(long pos, java.lang.String str) throws java.sql.SQLExceptionThis 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:
setStringin 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.SQLExceptionThis 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:
setStringin interfacejava.sql.Clob- Throws:
java.sql.SQLException- See Also:
Clob
-
setAsciiStream
public java.io.OutputStream setAsciiStream(long pos) throws java.sql.SQLExceptionThis 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:
setAsciiStreamin interfacejava.sql.Clob- Throws:
java.sql.SQLException- See Also:
Clob
-
setCharacterStream
public java.io.Writer setCharacterStream(long pos) throws java.sql.SQLExceptionThis 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:
setCharacterStreamin interfacejava.sql.Clob- Throws:
java.sql.SQLException- See Also:
Clob
-
truncate
public void truncate(long len) throws java.sql.SQLExceptionThis 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:
truncatein interfacejava.sql.Clob- Throws:
java.sql.SQLException- See Also:
Clob
-
getCharacterStream
public java.io.Reader getCharacterStream(long pos, long length) throws java.sql.SQLExceptionRaise error, not used by import- Specified by:
getCharacterStreamin interfacejava.sql.Clob- Throws:
java.sql.SQLException
-
free
public void free() throws java.sql.SQLExceptionRaise error, not used by import- Specified by:
freein interfacejava.sql.Clob- Throws:
java.sql.SQLException
-
methodNotImplemented
private java.sql.SQLException methodNotImplemented()
Return an unimplemented feature error
-
-