SQLFire 1.1

com.vmware.sqlfire.load
Class Import

java.lang.Object
  extended by com.vmware.sqlfire.internal.vti.VTITemplate
      extended by com.vmware.sqlfire.internal.impl.load.Import
          extended by com.vmware.sqlfire.load.Import
All Implemented Interfaces:
ResultSet, Wrapper

public class Import
extends com.vmware.sqlfire.internal.impl.load.Import

Allows users to extend the builtin Import class for custom overrides when loading data using SYSCS_UTIL.IMPORT_TABLE_EX/IMPORT_DATA_EX procedures. The Import procedure implements a ResultSet, so users can override/transform the individual columns or rows being returned from the import procedure. Use the Import.getColumnType(int) method to get the actual type of a column (Import.getMetaData() will only return binary/lob/string/udt types). The Import.getCurrentRow() method will return the whole row as an array of strings while Import.getCurrentLineNumber() returns the current line number (latter can be useful for error messages). To override individual columns, one or more of the following methods can be overridden:

ResultSet.getBytes(int): for BINARY types; data is normally serialized as a hex string

ResultSet.getBlob(int): for BLOB data types; note that if the LOBs are in an external file (IMPORT_XXX_LOBS_FROM_EXTFILE procedure), then an override may need to take care of reading from that external file

ResultSet.getClob(int): for CLOB data types; note that if the LOBs are in an external file (IMPORT_XXX_LOBS_FROM_EXTFILE procedure), then an override may need to take care of reading from that external file

ResultSet.getObject(int): for user-defined types; data is normally serialized as hex string, so typically implementations will invoke ResultSet.getBytes(int) to get the bytes and then deserialize it

ResultSet.getString(int): for all other data types the string read from the file is returned


Field Summary
 
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
 
Constructor Summary
Import(String inputFileName, String columnDelimiter, String characterDelimiter, String codeset, long offset, long endPosition, int noOfColumnsExpected, String columnTypes, boolean lobsInExtFile, int importCounter, String columnTypeNames, String udtClassNamesString)
          Constructor to invoke Import from a select statement.
 
Method Summary
static Object destringifyObject(String arg0)
           
static Object readObject(byte[] arg0)
           
 
Methods inherited from class com.vmware.sqlfire.internal.impl.load.Import
getColumnType, getCurrentRow, importData, importTable
 
Methods inherited from class com.vmware.sqlfire.internal.vti.VTITemplate
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getCharacterStream, getCharacterStream, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isWrapperFor, last, moveToCurrentRow, moveToInsertRow, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Import

public Import(String inputFileName,
              String columnDelimiter,
              String characterDelimiter,
              String codeset,
              long offset,
              long endPosition,
              int noOfColumnsExpected,
              String columnTypes,
              boolean lobsInExtFile,
              int importCounter,
              String columnTypeNames,
              String udtClassNamesString)
       throws SQLException
Constructor to invoke Import from a select statement. This will be invoked internally by the import procedures.

Throws:
SQLException
Method Detail

readObject

public static Object readObject(byte[] arg0)
                         throws Exception
Throws:
Exception

destringifyObject

public static Object destringifyObject(String arg0)
                                throws Exception
Throws:
Exception

SQLFire 1.1

Copyright © 2010-2013 VMware, Inc. All rights reserved.