|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbr.ufg.integrate.wrapper.csv.CSVReaderAdapter
br.ufg.integrate.wrapper.csv.CSVScrollableReader
public class CSVScrollableReader
This class Class provides facility to navigate on the Result Set.
| Field Summary |
|---|
| Fields inherited from class br.ufg.integrate.wrapper.csv.CSVReaderAdapter |
|---|
buf, charset, columnNames, columns, fileName, separator, suppressHeaders, tableName |
| Constructor Summary | |
|---|---|
CSVScrollableReader(String fileName)
Constructor for the CsvReader object |
|
CSVScrollableReader(String fileName,
char separator,
boolean suppressHeaders,
String charset)
Can be put in adpater apart from the last line Insert the method's description here. |
|
| Method Summary | |
|---|---|
boolean |
absolute(int row)
Moves the cursor to the given row number in this ResultSet object. |
void |
afterLast()
Moves the cursor to the end of this ResultSet object, just after the
last row. |
void |
beforeFirst()
Moves the cursor to the front of this ResultSet object, just before the
first row. |
void |
close()
Method close. |
boolean |
first()
Moves the cursor to the first row in this ResultSet object. |
int |
getRow()
Retrieves the current row number. |
boolean |
isAfterLast()
Retrieves whether the cursor is after the last row in this ResultSet object. |
boolean |
isBeforeFirst()
Retrieves whether the cursor is before the first row in this ResultSet object. |
boolean |
isFirst()
Retrieves whether the cursor is on the first row of this ResultSet object. |
boolean |
isLast()
Retrieves whether the cursor is on the last row of this ResultSet object. |
boolean |
last()
Moves the cursor to the last row in this ResultSet object. |
boolean |
next()
|
protected String[] |
parseCsvLine(String line)
|
boolean |
previous()
Moves the cursor to the previous row in this ResultSet object. |
boolean |
relative(int rows)
Moves the cursor a relative number of rows, either positive or negative. |
| Methods inherited from class br.ufg.integrate.wrapper.csv.CSVReaderAdapter |
|---|
getColumn, getColumn, getColumnNames, getLineCount, getTableName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSVScrollableReader(String fileName)
throws Exception
fileName - Description of Parameter
Exception - Description of Exception
public CSVScrollableReader(String fileName,
char separator,
boolean suppressHeaders,
String charset)
throws Exception
fileName - java.lang.Stringseparator - charsuppressHeaders - boolean
Exception - The exception description.| Method Detail |
|---|
protected String[] parseCsvLine(String line)
throws SQLException
parseCsvLine in class CSVReaderAdapterSQLExceptionpublic void close()
close in class CSVReaderAdapter
public boolean next()
throws SQLException
next in class CSVReaderAdapterSQLException
public boolean previous()
throws SQLException
ResultSet object.
previous in class CSVReaderAdaptertrue if the cursor is on a valid row;
false if it is off the result set
SQLException - if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
public boolean isBeforeFirst()
throws SQLException
ResultSet object.
isBeforeFirst in class CSVReaderAdaptertrue if the cursor is before the first row;
false if the cursor is at any other position or the
result set contains no rows
SQLException - if a database access error occurs
public boolean isAfterLast()
throws SQLException
ResultSet object.
isAfterLast in class CSVReaderAdaptertrue if the cursor is after the last row;
false if the cursor is at any other position or the
result set contains no rows
SQLException - if a database access error occurs
public boolean isFirst()
throws SQLException
ResultSet object.
isFirst in class CSVReaderAdaptertrue if the cursor is on the first row;
false otherwise
SQLException - if a database access error occurs
public boolean isLast()
throws SQLException
ResultSet object.
Note: Calling the method isLast may be expensive
because the JDBC driver
might need to fetch ahead one row in order to determine
whether the current row is the last row in the result set.
isLast in class CSVReaderAdaptertrue if the cursor is on the last row;
false otherwise
SQLException - if a database access error occurs
public void beforeFirst()
throws SQLException
ResultSet object, just before the
first row. This method has no effect if the result set contains no rows.
beforeFirst in class CSVReaderAdapterSQLException - if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
public void afterLast()
throws SQLException
ResultSet object, just after the
last row. This method has no effect if the result set contains no rows.
afterLast in class CSVReaderAdapterSQLException - if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
public boolean first()
throws SQLException
ResultSet object.
first in class CSVReaderAdaptertrue if the cursor is on a valid row;
false if there are no rows in the result set
SQLException - if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
public boolean last()
throws SQLException
ResultSet object.
last in class CSVReaderAdaptertrue if the cursor is on a valid row;
false if there are no rows in the result set
SQLException - if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
public int getRow()
throws SQLException
getRow in class CSVReaderAdapter0 if there is no current row
SQLException - if a database access error occurs
public boolean absolute(int row)
throws SQLException
ResultSet object.
If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on.
If the given row number is negative, the cursor moves to
an absolute row position with respect to
the end of the result set. For example, calling the method
absolute(-1) positions the
cursor on the last row; calling the method absolute(-2)
moves the cursor to the next-to-last row, and so on.
An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before the first row or after the last row.
Note: Calling absolute(1) is the same
as calling first(). Calling absolute(-1)
is the same as calling last().
absolute in class CSVReaderAdapterrow - the number of the row to which the cursor should move.
A positive number indicates the row number counting from the
beginning of the result set; a negative number indicates the
row number counting from the end of the result set
true if the cursor is on the result set;
false otherwise
SQLException - if a database access error
occurs, or the result set type is TYPE_FORWARD_ONLY
public boolean relative(int rows)
throws SQLException
relative(0) is valid, but does
not change the cursor position.
Note: Calling the method relative(1)
is identical to calling the method next() and
calling the method relative(-1) is identical
to calling the method previous().
relative in class CSVReaderAdapterrows - an int specifying the number of rows to
move from the current row; a positive number moves the cursor
forward; a negative number moves the cursor backward
true if the cursor is on a row;
false otherwise
SQLException - if a database access error occurs,
there is no current row, or the result set type is
TYPE_FORWARD_ONLY
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||