org.eclipse.datatools.connectivity.oda.flatfile.util
Class FlatFileDataReader

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.flatfile.util.FlatFileDataReader

public class FlatFileDataReader
extends java.lang.Object

FlatFileDataSourceReader is a utility class that help read and parse the raw data from flat file


Field Summary
static int MAX_ROWS_PER_FETCH
           
 
Constructor Summary
FlatFileDataReader(org.eclipse.datatools.connectivity.oda.flatfile.Connection connection, java.lang.String currentTableName, int statementMaxRows, IResultSetMetaData rsmd, org.eclipse.datatools.connectivity.oda.flatfile.ResultSetMetaDataHelper rsmdHelper)
          Constructor
 
Method Summary
 void clearBufferedReader()
           
 void finalize()
           
 int getColumnCount()
           
 java.lang.String[] getColumnNameArray(java.util.List<java.lang.String> line)
          Extract the column name from the line into the format of string array
 org.eclipse.datatools.connectivity.oda.flatfile.ResourceInputStream getInputStream()
           
 int getMaxRowsToRead(int resultSetMaxRows)
           
 java.lang.String[][] getSourceData()
           
static java.lang.String[] getStringArrayFromList(java.util.List<java.lang.String> list)
          Put the contants of the list into a string array
 boolean getTrailNullColumns()
           
static boolean isEmptyRow(java.util.List<java.lang.String> line)
          See if this row is empty or not
 java.util.List<java.lang.String> readLine()
          Read a row from the source data
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ROWS_PER_FETCH

public static final int MAX_ROWS_PER_FETCH
See Also:
Constant Field Values
Constructor Detail

FlatFileDataReader

public FlatFileDataReader(org.eclipse.datatools.connectivity.oda.flatfile.Connection connection,
                          java.lang.String currentTableName,
                          int statementMaxRows,
                          IResultSetMetaData rsmd,
                          org.eclipse.datatools.connectivity.oda.flatfile.ResultSetMetaDataHelper rsmdHelper)
                   throws OdaException
Constructor

Parameters:
connProperties - Connection properties
currentTableName - The current table name of this connection
statementMaxRows - The max number of rows specified in the query
rsmd - ResultSet meta-data
rsmdHelper - ResultSet meta-data helper
Throws:
OdaException
Method Detail

getTrailNullColumns

public boolean getTrailNullColumns()

getSourceData

public java.lang.String[][] getSourceData()
                                   throws OdaException
Returns:
Throws:
OdaException

readLine

public java.util.List<java.lang.String> readLine()
                                          throws OdaException
Read a row from the source data

Returns:
Throws:
OdaException
java.io.IOException

getMaxRowsToRead

public int getMaxRowsToRead(int resultSetMaxRows)
Parameters:
resultSetMaxRows -
Returns:

clearBufferedReader

public void clearBufferedReader()

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

getColumnCount

public int getColumnCount()
                   throws OdaException
Parameters:
connProperties -
tableName -
Returns:
Throws:
OdaException

getInputStream

public org.eclipse.datatools.connectivity.oda.flatfile.ResourceInputStream getInputStream()
                                                                                   throws OdaException
Throws:
OdaException

isEmptyRow

public static boolean isEmptyRow(java.util.List<java.lang.String> line)
                          throws OdaException
See if this row is empty or not

Parameters:
row -
Returns:
Throws:
OdaException

getColumnNameArray

public java.lang.String[] getColumnNameArray(java.util.List<java.lang.String> line)
                                      throws OdaException
Extract the column name from the line into the format of string array

Parameters:
line -
isFirstLine -
Returns:
Throws:
OdaException

getStringArrayFromList

public static java.lang.String[] getStringArrayFromList(java.util.List<java.lang.String> list)
Put the contants of the list into a string array

Parameters:
list -
Returns: