java.sql.ResultSet properties
|
next() |
Advances the ResultSet to the next result. It returns false at the
end of the data.
|
close() |
Closes the ResultSet.
|
wasNull() |
True if the last value read was null .
|
get(index) |
Returns a JavaScript object of the column given in the
index. |
getString(index) |
Return a string value from the column. |
getBoolean(index) |
Return a boolean value from the column. |
getInt(index) |
Returns an integer value from the column. |
getDouble(index) |
Return a double value from the column. |
getDate(index) |
Return a date value from the column. |
getTime(index) |
Return a time value from the column. |
getAsciiStream(index) |
Return an InputStream from the column. |
getUnicodeStream(index) |
Return an InputStream from the column. |
getBinaryStream(index) |
Return an InputStream from the column. |
toObject([object]) |
Reads the entire result set into the JavaScript object. |
java.sql.ResultSet properties
|
Advances the ResultSet to the next result. It returns false at the
end of the data.
Closes the ResultSet.
True if the last value read was null .
Returns a JavaScript object of the column given in the
index. This is the JavaScript equivalent of
getObject(index)
SQL type |
JavaScript type |
BIT |
boolean |
TINYINT |
number |
SMALLINT |
number |
INTEGER |
number |
FLOAT |
number |
REAL |
number |
DOUBLE |
number |
CHAR |
string |
VARCHAR |
string |
NULL |
null |
BIGINT |
string |
NUMERIC |
string |
DECIMAL |
string |
LONGVARCHAR |
InputStream |
DATE |
date |
TIME |
date |
TIMESTAMP |
date |
BINARY |
wrapped byte array |
VARBINARY |
wrapped byte array |
LONGVARBINARY |
InputStream |
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
get() using numeric index
rs = statement.executeQuery("select NAME, PRICE from ITEMS");
while (rs.next()) {
writeln(rs.get(1) + " " + rs.get(2));
}
|
Cappuccino 1.25
Mocha 1.90
Latte 1.75
Coffee 0.25
|
get() using string index
rs = statement.executeQuery("select NAME, PRICE from ITEMS");
while (rs.next()) {
writeln(rs.get("name") + " " + rs.get("price"));
}
|
Cappuccino 1.25
Mocha 1.90
Latte 1.75
Coffee 0.25
|
Return a string value from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Return a boolean value from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Returns an integer value from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Return a double value from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Return a date value from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Return a time value from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Return an InputStream from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Return an InputStream from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Return an InputStream from the column.
If index is a number, it returns the data for the
column number, otherwise it returns the data for the named column.
Reads the entire result set into the JavaScript object. If no
arguments are given, create a new object.
rs = statement.executeQuery("select NAME, PRICE from ITEMS");
while (rs.next()) {
obj = rs.toObject();
writeln(obj.name + " " + obj.price);
}
|
Copyright © 1998-2000 Caucho Technology. All rights reserved.
Last modified: Fri, 31 Mar 2000 18:55:13 -0800 (PST)
|