|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbr.ufg.integrate.wrapper.jdbc.IntegrateResultSet
br.ufg.integrate.wrapper.jdbc.impl.ResultSetImpl
br.ufg.integrate.wrapper.csv.CsvResultSet
public class CsvResultSet
This class implements the ResultSet interface for the CsvJdbc driver.
Field Summary | |
---|---|
protected String[] |
columnNames
Array of available columns for referenced table |
protected InputStream |
is
InputStream to keep track of |
protected int |
isScrollable
|
protected int |
lastIndexRead
Last column name index read |
protected CSVReaderAdapter |
reader
Helper class that performs the actual file reads |
protected ResultSetMetaData |
resultSetMetaData
Metadata for this ResultSet |
protected CsvStatement |
statement
Statement that produced this ResultSet |
protected String |
tableName
Table referenced by the Statement |
protected String |
whereColumnName
Column that is used on the where clause |
protected String |
whereValue
String that is sought for on the where column |
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 | |
---|---|
protected |
CsvResultSet(CsvStatement statement,
CSVReaderAdapter reader,
String tableName,
String[] columnNames,
int isScrollable)
Constructor for the CsvResultSet object |
protected |
CsvResultSet(CsvStatement statement,
CSVReaderAdapter reader,
String tableName,
String[] columnNames,
int isScrollable,
String whereColumnName,
String whereValue)
Constructor for the CsvResultSet object |
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()
Releases this ResultSet object's database and
JDBC resources immediately instead of waiting for
this to happen when it is automatically closed. |
int |
findColumn(String columnName)
Maps the given ResultSet column name to its
ResultSet column index. |
boolean |
first()
Moves the cursor to the first row in this ResultSet object. |
InputStream |
getAsciiStream(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as a stream of ASCII characters. |
InputStream |
getAsciiStream(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as a stream of
ASCII characters. |
BigDecimal |
getBigDecimal(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as a
java.math.BigDecimal with full precision. |
BigDecimal |
getBigDecimal(int columnIndex,
int scale)
Deprecated. |
BigDecimal |
getBigDecimal(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as a
java.math.BigDecimal with full precision. |
BigDecimal |
getBigDecimal(String columnName,
int scale)
Deprecated. |
InputStream |
getBinaryStream(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as a binary stream of
uninterpreted bytes. |
InputStream |
getBinaryStream(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as a stream of uninterpreted
byte s. |
boolean |
getBoolean(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a boolean in the Java programming language. |
boolean |
getBoolean(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a boolean in the Java programming language. |
byte |
getByte(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a byte in the Java programming language. |
byte |
getByte(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a byte in the Java programming language. |
byte[] |
getBytes(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a byte array in the Java programming language. |
byte[] |
getBytes(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a byte array in the Java programming language. |
Reader |
getCharacterStream(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as a
java.io.Reader object. |
Reader |
getCharacterStream(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as a
java.io.Reader object. |
int |
getConcurrency()
Retrieves the concurrency mode of this ResultSet object. |
Date |
getDate(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a java.sql.Date object in the Java programming language. |
Date |
getDate(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a java.sql.Date object in the Java programming language. |
double |
getDouble(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a double in the Java programming language. |
double |
getDouble(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a double in the Java programming language. |
float |
getFloat(int columnIndex)
Gets the value of the designated column in the current row of this ResultSet object as
a float in the Java programming language. |
float |
getFloat(String columnName)
Gets the value of the designated column in the current row of this ResultSet object as
a float in the Java programming language. |
int |
getInt(int columnIndex)
Gets the value of the designated column in the current row of this ResultSet object as
an int in the Java programming language. |
int |
getInt(String columnName)
Gets the value of the designated column in the current row of this ResultSet object as
an int in the Java programming language. |
long |
getLong(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a long in the Java programming language. |
long |
getLong(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a long in the Java programming language. |
ResultSetMetaData |
getMetaData()
Retrieves the number, types and properties of this ResultSet object's columns. |
Object |
getObject(int columnIndex)
Gets the value of the designated column in the current row of this ResultSet object as
an Object in the Java programming language. |
Object |
getObject(String columnName)
Gets the value of the designated column in the current row of this ResultSet object as
an Object in the Java programming language. |
int |
getRow()
Retrieves the current row number. |
short |
getShort(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a short in the Java programming language. |
short |
getShort(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a short in the Java programming language. |
Statement |
getStatement()
Retrieves the Statement object that produced this
ResultSet object. |
String |
getString(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a String in the Java programming language. |
String |
getString(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a String in the Java programming language. |
Time |
getTime(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as
a java.sql.Time object in the Java programming language. |
Time |
getTime(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a java.sql.Time object in the Java programming language. |
Timestamp |
getTimestamp(int columnIndex)
Retrieves the value of the designated column in the current row of this ResultSet object as a
java.sql.Timestamp object in the Java programming language. |
Timestamp |
getTimestamp(String columnName)
Retrieves the value of the designated column in the current row of this ResultSet object as
a java.sql.Timestamp object. |
int |
getType()
Retrieves the type of this ResultSet object. |
InputStream |
getUnicodeStream(int columnIndex)
Deprecated. use getCharacterStream in place of
getUnicodeStream |
InputStream |
getUnicodeStream(String columnName)
Deprecated. use getCharacterStream instead |
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 |
isClosed()
Implements method in interface java.sql.ResultSet |
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()
Moves the cursor down one row from its current position. |
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. |
boolean |
wasNull()
Reports whether the last column read had a value of SQL NULL . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ResultSetMetaData resultSetMetaData
protected CsvStatement statement
protected int isScrollable
protected CSVReaderAdapter reader
protected String tableName
protected String[] columnNames
protected int lastIndexRead
protected String whereColumnName
protected String whereValue
protected InputStream is
Constructor Detail |
---|
protected CsvResultSet(CsvStatement statement, CSVReaderAdapter reader, String tableName, String[] columnNames, int isScrollable)
statement
- Statement that produced this ResultSetreader
- Helper class that performs the actual file readstableName
- Table referenced by the StatementcolumnNames
- Array of available columns for referenced tableprotected CsvResultSet(CsvStatement statement, CSVReaderAdapter reader, String tableName, String[] columnNames, int isScrollable, String whereColumnName, String whereValue)
statement
- Statement that produced this ResultSetreader
- Helper class that performs the actual file readstableName
- Table referenced by the StatementcolumnNames
- Array of available columns for referenced tablewhereColumnName
- The zero base number for the columnwhereValue
- The string to be sought forMethod 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()
.
absolute
in interface ResultSet
absolute
in class ResultSetImpl
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
ResultSet.absolute(int)
public void close() throws SQLException
ResultSet
object's database and
JDBC resources immediately instead of waiting for
this to happen when it is automatically closed.
Note: A ResultSet
object
is automatically closed by the
Statement
object that generated it when
that Statement
object is closed,
re-executed, or is used to retrieve the next result from a
sequence of multiple results. A ResultSet
object
is also automatically closed when it is garbage collected.
close
in interface ResultSet
close
in class ResultSetImpl
SQLException
- if a database access error occursResultSet.close()
public InputStream getAsciiStream(int columnIndex) throws SQLException
ResultSet
object as a stream of ASCII characters.
The value can then be read in chunks from the stream. This method is
particularly suitable for retrieving large Note: All the data in the returned stream must be
read prior to getting the value of any other column. The next
call to a getter method implicitly closes the stream. Also, a
stream may return 0
when the method
InputStream.available
is called whether there is data available or not.
getAsciiStream
in interface ResultSet
getAsciiStream
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getAsciiStream(int)
public InputStream getAsciiStream(String columnName) throws SQLException
ResultSet
object as a stream of
ASCII characters. The value can then be read in chunks from the
stream. This method is particularly
suitable for retrieving large LONGVARCHAR
values.
The JDBC driver will
do any necessary conversion from the database format into ASCII.
Note: All the data in the returned stream must be
read prior to getting the value of any other column. The next
call to a getter method implicitly closes the stream. Also, a
stream may return 0
when the method available
is called whether there is data available or not.
getAsciiStream
in interface ResultSet
getAsciiStream
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
,
the value returned is null
.
SQLException
- if a database access error occursResultSet.getAsciiStream(int)
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
ResultSet
object as
a java.sql.BigDecimal
in the Java programming language.
getBigDecimal
in interface ResultSet
getBigDecimal
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...scale
- the number of digits to the right of the decimal point
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getBigDecimal(int, int)
public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException
ResultSet
object as
a java.math.BigDecimal
in the Java programming language.
getBigDecimal
in interface ResultSet
getBigDecimal
in class ResultSetImpl
columnName
- the SQL name of the columnscale
- the number of digits to the right of the decimal point
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getBigDecimal(int, int)
public InputStream getBinaryStream(int columnIndex) throws SQLException
ResultSet
object as a binary stream of
uninterpreted bytes. The value can then be read in chunks from the
stream. This method is particularly
suitable for retrieving large LONGVARBINARY
values.
Note: All the data in the returned stream must be
read prior to getting the value of any other column. The next
call to a getter method implicitly closes the stream. Also, a
stream may return 0
when the method
InputStream.available
is called whether there is data available or not.
getBinaryStream
in interface ResultSet
getBinaryStream
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the value returned is
null
SQLException
- if a database access error occursResultSet.getBinaryStream(int)
public InputStream getBinaryStream(String columnName) throws SQLException
ResultSet
object as a stream of uninterpreted
byte
s.
The value can then be read in chunks from the
stream. This method is particularly
suitable for retrieving large LONGVARBINARY
values.
Note: All the data in the returned stream must be
read prior to getting the value of any other column. The next
call to a getter method implicitly closes the stream. Also, a
stream may return 0
when the method available
is called whether there is data available or not.
getBinaryStream
in interface ResultSet
getBinaryStream
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the result is null
SQLException
- if a database access error occursResultSet.getBinaryStream(int)
public boolean getBoolean(int columnIndex) throws SQLException
ResultSet
object as
a boolean
in the Java programming language.
getBoolean
in interface ResultSet
getBoolean
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is false
SQLException
- if a database access error occursResultSet.getBoolean(int)
public boolean getBoolean(String columnName) throws SQLException
ResultSet
object as
a boolean
in the Java programming language.
getBoolean
in interface ResultSet
getBoolean
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is false
SQLException
- if a database access error occursResultSet.getBoolean(int)
public byte getByte(int columnIndex) throws SQLException
ResultSet
object as
a byte
in the Java programming language.
getByte
in interface ResultSet
getByte
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getByte(int)
public byte getByte(String columnName) throws SQLException
ResultSet
object as
a byte
in the Java programming language.
getByte
in interface ResultSet
getByte
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getByte(int)
public byte[] getBytes(int columnIndex) throws SQLException
ResultSet
object as
a byte
array in the Java programming language.
The bytes represent the raw values returned by the driver.
getBytes
in interface ResultSet
getBytes
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getBytes(int)
public byte[] getBytes(String columnName) throws SQLException
ResultSet
object as
a byte
array in the Java programming language.
The bytes represent the raw values returned by the driver.
getBytes
in interface ResultSet
getBytes
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getBytes(int)
public Date getDate(int columnIndex) throws SQLException
ResultSet
object as
a java.sql.Date
object in the Java programming language.
getDate
in interface ResultSet
getDate
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getDate(int)
public double getDouble(int columnIndex) throws SQLException
ResultSet
object as
a double
in the Java programming language.
getDouble
in interface ResultSet
getDouble
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getDouble(int)
public double getDouble(String columnName) throws SQLException
ResultSet
object as
a double
in the Java programming language.
getDouble
in interface ResultSet
getDouble
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getDouble(int)
public float getFloat(int columnIndex) throws SQLException
ResultSet
object as
a float
in the Java programming language.
getFloat
in interface ResultSet
getFloat
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getFloat(int)
public float getFloat(String columnName) throws SQLException
ResultSet
object as
a float
in the Java programming language.
getFloat
in interface ResultSet
getFloat
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getFloat(int)
public int getInt(int columnIndex) throws SQLException
ResultSet
object as
an int
in the Java programming language.
getInt
in interface ResultSet
getInt
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getInt(int)
public int getInt(String columnName) throws SQLException
ResultSet
object as
an int
in the Java programming language.
getInt
in interface ResultSet
getInt
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getInt(int)
public long getLong(int columnIndex) throws SQLException
ResultSet
object as
a long
in the Java programming language.
getLong
in interface ResultSet
getLong
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getLong(int)
public long getLong(String columnName) throws SQLException
ResultSet
object as
a long
in the Java programming language.
getLong
in interface ResultSet
getLong
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getLong(int)
public short getShort(int columnIndex) throws SQLException
ResultSet
object as
a short
in the Java programming language.
getShort
in interface ResultSet
getShort
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getShort(int)
public short getShort(String columnName) throws SQLException
ResultSet
object as
a short
in the Java programming language.
getShort
in interface ResultSet
getShort
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is 0
SQLException
- if a database access error occursResultSet.getShort(int)
public String getString(int columnIndex) throws SQLException
ResultSet
object as
a String
in the Java programming language.
getString
in interface ResultSet
getString
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getString(int)
public String getString(String columnName) throws SQLException
ResultSet
object as
a String
in the Java programming language.
getString
in interface ResultSet
getString
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getString(int)
public Time getTime(int columnIndex) throws SQLException
ResultSet
object as
a java.sql.Time
object in the Java programming language.
getTime
in interface ResultSet
getTime
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getTime(int)
public Timestamp getTimestamp(int columnIndex) throws SQLException
ResultSet
object as a
java.sql.Timestamp
object in the Java programming language.
getTimestamp
in interface ResultSet
getTimestamp
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getTimestamp(int)
public InputStream getUnicodeStream(int columnIndex) throws SQLException
getCharacterStream
in place of
getUnicodeStream
ResultSet
object as
as a stream of two-byte Unicode characters. The first byte is
the high byte; the second byte is the low byte.
The value can then be read in chunks from the
stream. This method is particularly
suitable for retrieving large LONGVARCHAR
values. The
JDBC driver will do any necessary conversion from the database
format into Unicode.
Note: All the data in the returned stream must be
read prior to getting the value of any other column. The next
call to a getter method implicitly closes the stream.
Also, a stream may return 0
when the method
InputStream.available
is called, whether there is data available or not.
getUnicodeStream
in interface ResultSet
getUnicodeStream
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the value returned is
null
SQLException
- if a database access error occursResultSet.getUnicodeStream(int)
public Date getDate(String columnName) throws SQLException
ResultSet
object as
a java.sql.Date
object in the Java programming language.
getDate
in interface ResultSet
getDate
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getDate(int)
public Time getTime(String columnName) throws SQLException
ResultSet
object as
a java.sql.Time
object in the Java programming language.
getTime
in interface ResultSet
getTime
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
,
the value returned is null
SQLException
- if a database access error occursResultSet.getTime(int)
public Timestamp getTimestamp(String columnName) throws SQLException
ResultSet
object as
a java.sql.Timestamp
object.
getTimestamp
in interface ResultSet
getTimestamp
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the
value returned is null
SQLException
- if a database access error occursResultSet.getTimestamp(int)
public InputStream getUnicodeStream(String columnName) throws SQLException
getCharacterStream
instead
ResultSet
object as a stream of two-byte
Unicode characters. The first byte is the high byte; the second
byte is the low byte.
The value can then be read in chunks from the
stream. This method is particularly
suitable for retrieving large LONGVARCHAR
values.
The JDBC technology-enabled driver will
do any necessary conversion from the database format into Unicode.
Note: All the data in the returned stream must be
read prior to getting the value of any other column. The next
call to a getter method implicitly closes the stream.
Also, a stream may return 0
when the method
InputStream.available
is called, whether there
is data available or not.
getUnicodeStream
in interface ResultSet
getUnicodeStream
in class ResultSetImpl
columnName
- the SQL name of the column
NULL
, the value returned
is null
.
SQLException
- if a database access error occursResultSet.getUnicodeStream(int)
public ResultSetMetaData getMetaData() throws SQLException
ResultSet
object's columns.
getMetaData
in interface ResultSet
getMetaData
in class ResultSetImpl
ResultSet
object's columns
SQLException
- if a database access error occursResultSet.getMetaData()
public Object getObject(int columnIndex) throws SQLException
Gets the value of the designated column in the current row
of this ResultSet
object as
an Object
in the Java programming language.
This method will return the value of the given column as a
Java object. The type of the Java object will be the default
Java object type corresponding to the column's SQL type,
following the mapping for built-in types specified in the JDBC
specification. If the value is an SQL NULL
,
the driver returns a Java null
.
This method may also be used to read datatabase-specific
abstract data types.
In the JDBC 2.0 API, the behavior of method
getObject
is extended to materialize
data of SQL user-defined types. When a column contains
a structured or distinct value, the behavior of this method is as
if it were a call to: getObject(columnIndex,
this.getStatement().getConnection().getTypeMap())
.
getObject
in interface ResultSet
getObject
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
java.lang.Object
holding the column value
SQLException
- if a database access error occursResultSet.getObject(int)
public Object getObject(String columnName) throws SQLException
Gets the value of the designated column in the current row
of this ResultSet
object as
an Object
in the Java programming language.
This method will return the value of the given column as a
Java object. The type of the Java object will be the default
Java object type corresponding to the column's SQL type,
following the mapping for built-in types specified in the JDBC
specification. If the value is an SQL NULL
,
the driver returns a Java null
.
This method may also be used to read datatabase-specific abstract data types.
In the JDBC 2.0 API, the behavior of the method
getObject
is extended to materialize
data of SQL user-defined types. When a column contains
a structured or distinct value, the behavior of this method is as
if it were a call to: getObject(columnIndex,
this.getStatement().getConnection().getTypeMap())
.
getObject
in interface ResultSet
getObject
in class ResultSetImpl
columnName
- the SQL name of the column
java.lang.Object
holding the column value
SQLException
- if a database access error occursResultSet.getObject(int)
public int findColumn(String columnName) throws SQLException
ResultSet
column name to its
ResultSet
column index.
findColumn
in interface ResultSet
findColumn
in class ResultSetImpl
columnName
- the name of the column
SQLException
- if the ResultSet
object does
not contain columnName
or a database access error occursResultSet.findColumn(java.lang.String)
public Reader getCharacterStream(int columnIndex) throws SQLException
ResultSet
object as a
java.io.Reader
object.
getCharacterStream
in interface ResultSet
getCharacterStream
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
java.io.Reader
object that contains the column
value; if the value is SQL NULL
, the value returned is
null
in the Java programming language.
SQLException
- if a database access error occursResultSet.getCharacterStream(int)
public Reader getCharacterStream(String columnName) throws SQLException
ResultSet
object as a
java.io.Reader
object.
getCharacterStream
in interface ResultSet
getCharacterStream
in class ResultSetImpl
columnName
- the name of the column
java.io.Reader
object that contains the column
value; if the value is SQL NULL
, the value returned is
null
in the Java programming language
SQLException
- if a database access error occursResultSet.getCharacterStream(int)
public BigDecimal getBigDecimal(int columnIndex) throws SQLException
ResultSet
object as a
java.math.BigDecimal
with full precision.
getBigDecimal
in interface ResultSet
getBigDecimal
in class ResultSetImpl
columnIndex
- the first column is 1, the second is 2, ...
NULL
, the value returned is
null
in the Java programming language.
SQLException
- if a database access error occursResultSet.getBigDecimal(int, int)
public BigDecimal getBigDecimal(String columnName) throws SQLException
ResultSet
object as a
java.math.BigDecimal
with full precision.
getBigDecimal
in interface ResultSet
getBigDecimal
in class ResultSetImpl
columnName
- the column name
NULL
, the value returned is
null
in the Java programming language.
SQLException
- if a database access error occursResultSet.getBigDecimal(int, int)
public boolean isBeforeFirst() throws SQLException
ResultSet
object.
isBeforeFirst
in interface ResultSet
isBeforeFirst
in class ResultSetImpl
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 occursResultSet.isBeforeFirst()
public boolean isAfterLast() throws SQLException
ResultSet
object.
isAfterLast
in interface ResultSet
isAfterLast
in class ResultSetImpl
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 occursResultSet.isAfterLast()
public boolean isFirst() throws SQLException
ResultSet
object.
isFirst
in interface ResultSet
isFirst
in class ResultSetImpl
true
if the cursor is on the first row;
false
otherwise
SQLException
- if a database access error occursResultSet.isFirst()
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 interface ResultSet
isLast
in class ResultSetImpl
true
if the cursor is on the last row;
false
otherwise
SQLException
- if a database access error occursResultSet.isLast()
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 interface ResultSet
beforeFirst
in class ResultSetImpl
SQLException
- if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
ResultSet.beforeFirst()
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 interface ResultSet
afterLast
in class ResultSetImpl
SQLException
- if a database access error
occurs or the result set type is TYPE_FORWARD_ONLY
ResultSet.afterLast()
public boolean first() throws SQLException
ResultSet
object.
first
in interface ResultSet
first
in class ResultSetImpl
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
ResultSet.first()
public boolean last() throws SQLException
ResultSet
object.
last
in interface ResultSet
last
in class ResultSetImpl
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
ResultSet.last()
public int getRow() throws SQLException
getRow
in interface ResultSet
getRow
in class ResultSetImpl
0
if there is no current row
SQLException
- if a database access error occursResultSet.getRow()
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 interface ResultSet
relative
in class ResultSetImpl
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
ResultSet.relative(int)
public boolean previous() throws SQLException
ResultSet
object.
previous
in interface ResultSet
previous
in class ResultSetImpl
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
ResultSet.previous()
public int getType() throws SQLException
ResultSet
object.
The type is determined by the Statement
object
that created the result set.
getType
in interface ResultSet
getType
in class ResultSetImpl
ResultSet.TYPE_FORWARD_ONLY
,
ResultSet.TYPE_SCROLL_INSENSITIVE
,
or ResultSet.TYPE_SCROLL_SENSITIVE
SQLException
- if a database access error occursResultSet.getType()
public int getConcurrency() throws SQLException
ResultSet
object.
The concurrency used is determined by the
Statement
object that created the result set.
getConcurrency
in interface ResultSet
getConcurrency
in class ResultSetImpl
ResultSet.CONCUR_READ_ONLY
or ResultSet.CONCUR_UPDATABLE
SQLException
- if a database access error occursResultSet.getConcurrency()
public boolean next() throws SQLException
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.
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.
next
in interface ResultSet
next
in class ResultSetImpl
true
if the new current row is valid;
false
if there are no more rows
SQLException
- if a database access error occursResultSet.next()
public boolean wasNull() throws SQLException
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
.
wasNull
in interface ResultSet
wasNull
in class ResultSetImpl
true
if the last column value read was SQL
NULL
and false
otherwise
SQLException
- if a database access error occursResultSet.wasNull()
public Statement getStatement() throws SQLException
Statement
object that produced this
ResultSet
object.
If the result set was generated some other way, such as by a
DatabaseMetaData
method, this method returns
null
.
getStatement
in interface ResultSet
getStatement
in class ResultSetImpl
Statment
object that produced
this ResultSet
object or null
if the result set was produced some other way
SQLException
- if a database access error occursResultSet.getStatement()
public boolean isClosed() throws SQLException
ResultSetImpl
isClosed
in interface ResultSet
isClosed
in class ResultSetImpl
SQLException
ResultSet.isClosed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |