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

pack-priv abstract Class ImportAbstract

extends VTITemplate
Class Inheritance
Known Direct Subclasses
org.apache.derby.impl.load.Import
Imports
java.io.ByteArrayInputStream, .ObjectInputStream, java.sql.SQLException, .SQLWarning, .ResultSetMetaData, org.apache.derby.vti.VTITemplate, java.util.ArrayList, .HashMap, org.apache.derby.iapi.util.StringUtil, org.apache.derby.shared.common.error.PublicAPI, .StandardException, org.apache.derby.shared.common.reference.SQLState

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv String[]
pack-priv String[]
pack-priv String
pack-priv int[]
pack-priv ControlInfo
pack-priv ImportReadData
pack-priv ImportResultSetMetaData
pack-priv int
protected boolean
pack-priv String[]
pack-priv int
pack-priv int
pack-priv int[]
pack-priv String
pack-priv HashMap<K, V>
pack-priv String
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.sql.ResultSet.close.

closes the resultset

public static Object
destringifyObject(String raw)

Read an object which was serialized to a string using StringUtil

pack-priv void
doAllTheWork()

Does all the work

public Blob
getBlob(int
number of the column. starts at 1.
columnIndex
)

Overrides org.apache.derby.vti.VTITemplate.getBlob.

Implements java.sql.ResultSet.getBlob.

Returns java.sql.Blob type object that contains the column data from the import file.

public byte[]
getBytes(int
number of the column. starts at 1.
columnIndex
)

Overrides org.apache.derby.vti.VTITemplate.getBytes.

Implements java.sql.ResultSet.getBytes.

Returns byte array that contains the column data from the import file.

public Clob
getClob(int
number of the column. starts at 1.
columnIndex
)

Overrides org.apache.derby.vti.VTITemplate.getClob.

Implements java.sql.ResultSet.getClob.

Returns java.sql.Clob type object that contains the column data from the import file.

public int
getCurrentLineNumber()

gets the current line number

pack-priv abstract ImportReadData
public ResultSetMetaData
public Object
getObject(int
number of the column. starts at 1.
columnIndex
)

Overrides org.apache.derby.vti.VTITemplate.getObject.

Implements java.sql.ResultSet.getObject.

Returns Object that contains the column data from the import file.

public int
public String
getString(int
the first column is 1, the second is 2, ...
columnIndex
)

Overrides org.apache.derby.vti.VTITemplate.getString.

Implements java.sql.ResultSet.getString.

Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.

public SQLException
importError(Exception
Exception causing the import error
ex
)

Close the stream and wrap exception in a SQLException

private boolean

Returns:

true, if the column data in a different file from the main import file , otherwise false.
isColumnInExtFile
(int
number of the column. starts at 1.
colIndex
)

Check if for this column type, real data is stored in an external file and only the reference is in the main import file.

pack-priv void
public boolean
next()

Implements java.sql.ResultSet.next.

Moves the cursor forward one row from its current position.

public static Object
readObject(byte[] bytes)

Read a serializable from a set of bytes.

public boolean
wasNull()

Overrides org.apache.derby.vti.VTITemplate.wasNull.

Implements java.sql.ResultSet.wasNull.

Reports whether the last column read had a value of SQL NULL.

Inherited from org.apache.derby.vti.VTITemplate:
absoluteafterLastbeforeFirstcancelRowUpdatesclearWarningsdeleteRowfindColumnfirstgetArraygetArraygetAsciiStreamgetAsciiStreamgetBigDecimalgetBigDecimalgetBigDecimalgetBigDecimalgetBinaryStreamgetBinaryStreamgetBlobgetBooleangetBooleangetBytegetBytegetBytesgetCharacterStreamgetCharacterStreamgetClobgetConcurrencygetContextgetCursorNamegetDategetDategetDategetDategetDoublegetDoublegetFetchDirectiongetFetchSizegetFloatgetFloatgetHoldabilitygetIntgetIntgetLonggetLonggetNCharacterStreamgetNCharacterStreamgetNClobgetNClobgetNStringgetNStringgetObjectgetObjectgetObjectgetObjectgetObjectgetRefgetRefgetReturnTableSignaturegetRowIdgetRowIdgetShortgetShortgetSQLXMLgetSQLXMLgetStatementgetStringgetTimegetTimegetTimegetTimegetTimestampgetTimestampgetTimestampgetTimestampgetTypegetUnicodeStreamgetUnicodeStreamgetURLgetURLgetWarningsinsertRowisAfterLastisBeforeFirstisClosedisFirstisLastisWrapperForlastmoveToCurrentRowmoveToInsertRownotImplementedpreviousrefreshRowrelativerowDeletedrowInsertedrowUpdatedsetContextsetFetchDirectionsetFetchSizeunwrapupdateArrayupdateArrayupdateAsciiStreamupdateAsciiStreamupdateAsciiStreamupdateAsciiStreamupdateAsciiStreamupdateAsciiStreamupdateBigDecimalupdateBigDecimalupdateBinaryStreamupdateBinaryStreamupdateBinaryStreamupdateBinaryStreamupdateBinaryStreamupdateBinaryStreamupdateBlobupdateBlobupdateBlobupdateBlobupdateBlobupdateBlobupdateBooleanupdateBooleanupdateByteupdateByteupdateBytesupdateBytesupdateCharacterStreamupdateCharacterStreamupdateCharacterStreamupdateCharacterStreamupdateCharacterStreamupdateCharacterStreamupdateClobupdateClobupdateClobupdateClobupdateClobupdateClobupdateDateupdateDateupdateDoubleupdateDoubleupdateFloatupdateFloatupdateIntupdateIntupdateLongupdateLongupdateNCharacterStreamupdateNCharacterStreamupdateNCharacterStreamupdateNCharacterStreamupdateNClobupdateNClobupdateNClobupdateNClobupdateNClobupdateNClobupdateNStringupdateNStringupdateNullupdateNullupdateObjectupdateObjectupdateObjectupdateObjectupdateRefupdateRefupdateRowupdateRowIdupdateRowIdupdateShortupdateShortupdateSQLXMLupdateSQLXMLupdateStringupdateStringupdateTimeupdateTimeupdateTimestampupdateTimestamp

Field Detail

COLUMNNAMEPREFIXback to summary
pack-priv static final String COLUMNNAMEPREFIX
columnNamesback to summary
pack-priv String[] columnNames
columnTypeNamesback to summary
pack-priv String[] columnTypeNames
columnTypeNamesStringback to summary
pack-priv String columnTypeNamesString
columnWidthsback to summary
pack-priv int[] columnWidths
controlFileReaderback to summary
pack-priv ControlInfo controlFileReader
importReadDataback to summary
pack-priv ImportReadData importReadData
importResultSetMetaDataback to summary
pack-priv ImportResultSetMetaData importResultSetMetaData
lineNumberback to summary
pack-priv int lineNumber
lobsInExtFileback to summary
protected boolean lobsInExtFile
nextRowback to summary
pack-priv String[] nextRow
noOfColumnsExpectedback to summary
pack-priv int noOfColumnsExpected
numberOfColumnsback to summary
pack-priv int numberOfColumns
tableColumnTypesback to summary
pack-priv int[] tableColumnTypes
tableColumnTypesStrback to summary
pack-priv String tableColumnTypesStr
udtClassesback to summary
pack-priv HashMap<K, V> udtClasses
udtClassNamesStringback to summary
pack-priv String udtClassNamesString
wasNullback to summary
private boolean wasNull

Constructor Detail

ImportAbstractback to summary
pack-priv ImportAbstract()

Method Detail

closeback to summary
public void close() throws SQLException

Implements java.sql.ResultSet.close.

closes the resultset

Exceptions
SQLException:
if there is an error
destringifyObjectback to summary
public static Object destringifyObject(String raw) throws Exception

Read an object which was serialized to a string using StringUtil

doAllTheWorkback to summary
pack-priv void doAllTheWork() throws Exception

Does all the work

Exceptions
Exception:
if there is an error
getBlobback to summary
public Blob getBlob(int columnIndex) throws SQLException

Overrides org.apache.derby.vti.VTITemplate.getBlob.

Implements java.sql.ResultSet.getBlob.

Returns java.sql.Blob type object that contains the column data from the import file.

Parameters
columnIndex:int

number of the column. starts at 1.

Returns:Blob

Doc from java.sql.ResultSet.getBlob.

a Blob object representing the SQL BLOB value in the specified column

Exceptions
SQLException:
if any occurs during create of the blob object.
getBytesback to summary
public byte[] getBytes(int columnIndex) throws SQLException

Overrides org.apache.derby.vti.VTITemplate.getBytes.

Implements java.sql.ResultSet.getBytes.

Returns byte array that contains the column data from the import file.

Parameters
columnIndex:int

number of the column. starts at 1.

Returns:byte[]

Doc from java.sql.ResultSet.getBytes.

the column value; if the value is SQL NULL, the value returned is null

Exceptions
SQLException:
if any error occurs.
getClobback to summary
public Clob getClob(int columnIndex) throws SQLException

Overrides org.apache.derby.vti.VTITemplate.getClob.

Implements java.sql.ResultSet.getClob.

Returns java.sql.Clob type object that contains the column data from the import file.

Parameters
columnIndex:int

number of the column. starts at 1.

Returns:Clob

Doc from java.sql.ResultSet.getClob.

a Clob object representing the SQL CLOB value in the specified column

Exceptions
SQLException:
if any occurs during create of the clob object.
getCurrentLineNumberback to summary
public int getCurrentLineNumber()

gets the current line number

getImportReadDataback to summary
pack-priv abstract ImportReadData getImportReadData() throws Exception
getMetaDataback to summary
public ResultSetMetaData getMetaData()

Overrides org.apache.derby.vti.VTITemplate.getMetaData.

Implements java.sql.ResultSet.getMetaData.

Gets the resultset meta data

Returns:ResultSetMetaData

Doc from java.sql.ResultSet.getMetaData.

the description of this ResultSet object's columns

Exceptions
SQLException:
if there is an error
getObjectback to summary
public Object getObject(int columnIndex) throws SQLException

Overrides org.apache.derby.vti.VTITemplate.getObject.

Implements java.sql.ResultSet.getObject.

Returns Object that contains the column data from the import file.

Parameters
columnIndex:int

number of the column. starts at 1.

Returns:Object

Doc from java.sql.ResultSet.getObject.

a java.lang.Object holding the column value

Exceptions
SQLException:
if any error occurs.
getRowback to summary
public int getRow() throws SQLException

Overrides org.apache.derby.vti.VTITemplate.getRow.

Implements java.sql.ResultSet.getRow.

gets the next row

Returns:int

Doc from java.sql.ResultSet.getRow.

the current row number; 0 if there is no current row

Exceptions
SQLException:
if there is an error
getStringback to summary
public String getString(int columnIndex) throws SQLException

Overrides org.apache.derby.vti.VTITemplate.getString.

Implements java.sql.ResultSet.getString.

Doc from java.sql.ResultSet.getString.

Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.

Parameters
columnIndex:int

the first column is 1, the second is 2, ...

Returns:String

the column value; if the value is SQL NULL, the value returned is null

Exceptions
SQLException:
if there is an error
importErrorback to summary
public SQLException importError(Exception ex)

Close the stream and wrap exception in a SQLException

Parameters
ex:Exception

Exception causing the import error

isColumnInExtFileback to summary
private boolean isColumnInExtFile(int colIndex)

Check if for this column type, real data is stored in an external file and only the reference is in the main import file.

Parameters
colIndex:int

number of the column. starts at 1.

Returns:boolean

true, if the column data in a different file from the main import file , otherwise false.

loadColumnNamesback to summary
pack-priv void loadColumnNames()
nextback to summary
public boolean next() throws SQLException

Implements java.sql.ResultSet.next.

Doc from java.sql.ResultSet.next.

Moves the cursor forward one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.

When a call to the next method returns false, the cursor is positioned after the last row. Any invocation of a ResultSet method which requires a current row will result in a SQLException being thrown. If the result set type is TYPE_FORWARD_ONLY, it is vendor specified whether their JDBC driver implementation will return false or throw an SQLException on a subsequent call to next.

If an input stream is open for the current row, a call to the method next will implicitly close it. A ResultSet object's warning chain is cleared when a new row is read.

Returns:boolean

true if the new current row is valid; false if there are no more rows

Exceptions
SQLException:
if a database access error occurs or this method is called on a closed result set
readObjectback to summary
public static Object readObject(byte[] bytes) throws Exception

Read a serializable from a set of bytes.

wasNullback to summary
public boolean wasNull()

Overrides org.apache.derby.vti.VTITemplate.wasNull.

Implements java.sql.ResultSet.wasNull.

Doc from java.sql.ResultSet.wasNull.

Reports whether the last column read had a value of SQL NULL. Note that you must first call one of the getter methods on a column to try to read its value and then call the method wasNull to see if the value read was SQL NULL.

Returns:boolean

true if the last column value read was SQL NULL and false otherwise