|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbr.ufg.integrate.wrapper.csv.CSVReaderAdapter
public abstract class CSVReaderAdapter
This class an abstract class that contains the common functionality of the Scrollable and Non Scrollable Reader
Field Summary | |
---|---|
protected String |
buf
|
protected String |
charset
|
protected String[] |
columnNames
|
protected String[] |
columns
|
protected String |
fileName
|
protected char |
separator
|
protected boolean |
suppressHeaders
|
protected String |
tableName
|
Constructor Summary | |
---|---|
CSVReaderAdapter()
|
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. |
abstract void |
close()
|
boolean |
first()
Moves the cursor to the first row in this ResultSet object. |
String |
getColumn(int columnIndex)
Get the value of the column at the specified index. |
String |
getColumn(String columnName)
Get value from column at specified name. |
String[] |
getColumnNames()
Gets the columnNames attribute of the CsvReader object |
int |
getLineCount()
Retorna a quantidade de linhas (para consultas do tipo COUNT(*). |
int |
getRow()
Retrieves the current row number. |
String |
getTableName()
|
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. |
abstract boolean |
next()
|
protected abstract 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String[] columnNames
protected String[] columns
protected String buf
protected char separator
protected boolean suppressHeaders
protected String tableName
protected String fileName
protected String charset
Constructor Detail |
---|
public CSVReaderAdapter()
Method Detail |
---|
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()
.
row
- 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 void afterLast() throws SQLException
ResultSet
object, just after the
last row. This method has no effect if the result set contains no rows.
SQLException
- if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
public void beforeFirst() throws SQLException
ResultSet
object, just before the
first row. This method has no effect if the result set contains no rows.
SQLException
- if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
public abstract void close()
public boolean first() throws SQLException
ResultSet
object.
true
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 String getColumn(int columnIndex) throws SQLException
columnIndex
- Description of Parameter
SQLException
public String getColumn(String columnName) throws SQLException
columnName
- Description of Parameter
SQLException
- Description of Exceptionpublic String[] getColumnNames()
public int getLineCount()
public int getRow() throws SQLException
0
if there is no current row
SQLException
- if a database access error occurspublic String getTableName()
public boolean isAfterLast() throws SQLException
ResultSet
object.
true
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 occurspublic boolean isBeforeFirst() throws SQLException
ResultSet
object.
true
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 occurspublic boolean isFirst() throws SQLException
ResultSet
object.
true
if the cursor is on the first row;
false
otherwise
SQLException
- if a database access error occurspublic 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.
true
if the cursor is on the last row;
false
otherwise
SQLException
- if a database access error occurspublic boolean last() throws SQLException
ResultSet
object.
true
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 abstract boolean next() throws SQLException
SQLException
protected abstract String[] parseCsvLine(String line) throws SQLException
SQLException
public boolean previous() throws SQLException
ResultSet
object.
true
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 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()
.
rows
- 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 All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |