|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkdl.prox.monet.ResultSet
public class ResultSet
A ResultSet derived from a query. Provides next() and getColumn(i) methods, and getRowCount()
Reads the entire resultSet into memory first, and them users can retrieve each column with calls to next() and getColumn(i) and its derivatives. Passing data from the Monet server to Java is time-consuming, and reading large result sets into memory will consume lots of memory, so users should keep resultSets are small as possible.
| Field Summary | |
|---|---|
protected java.util.ArrayList<java.lang.String> |
columnValueList
The list of column values (as strings) for the current row First set by processcolumnNames, and then updated in every call to next() |
protected java.lang.String |
currentLine
The last line read - returned by getLine() next() sets currentLine to the next line, and processes it |
protected MonetStream |
monetStream
IVs. |
protected java.lang.String |
queryText
|
protected java.util.List<java.lang.String> |
resultSetLines
Stores all the lines returned by the resultSet. |
protected int |
rowCount
The number of rows in the resultSet. |
protected int |
rowNum
The current row Starts with 0 when the resultSet is created Advances with each call to next() Is set to -1 when next() goes past the last row |
| Constructor Summary | |
|---|---|
ResultSet()
Default constructor |
|
ResultSet(MonetStream monetStream,
java.lang.String query)
Full-arg constructor. |
|
| Method Summary | |
|---|---|
boolean |
getBoolean(int columnIndex)
Returns a column in the current row as a boolean |
boolean |
getBoolean(java.lang.String col)
|
char |
getChar(int columnIndex)
Returns a column in the current row as a char |
char |
getChar(java.lang.String col)
|
java.lang.String |
getColumn(int i)
Returns the content of the ith column, as a string. |
java.lang.String |
getColumn(java.lang.String col)
|
int |
getColumnCount()
Returns the number of columns in the resultSet columnValueList is first initialized by processcolumnNames |
java.util.List |
getColumnList()
Returns the current line, as a list of strings, one for each column |
double |
getDouble(int columnIndex)
Returns a column in the current row as a double |
double |
getDouble(java.lang.String col)
|
float |
getFloat(int columnIndex)
Returns a column in the current row as a float |
float |
getFloat(java.lang.String col)
|
int |
getInt(int columnIndex)
Returns a column in the current row as an int |
int |
getInt(java.lang.String col)
|
java.lang.String |
getLine()
Returns the current line, as read from the Monet server |
int |
getOID(int columnIndex)
getInt() variation that is called when the desired column is known to be an OID. |
int |
getOID(java.lang.String col)
|
java.lang.String |
getQueryText()
Returns the text of the query that created this resultSet |
int |
getRowCount()
Returns the number of rows in this resultSet Rows go from 0 - (rowCount-1) |
java.lang.String |
getString(int columnIndex)
Returns a column in the current row as a string |
java.lang.String |
getString(java.lang.String col)
|
boolean |
isColumnNil(int columnIndex)
Returns true if the ith column was the Monet nil value. |
boolean |
isColumnNil(java.lang.String col)
|
boolean |
next()
Advances the pointer |
ResultSet |
setColumnNames(java.lang.String[] colNames)
Sets names for the columns in the resultSet, so you can used named get'ers |
int |
size()
For compatibility with JDBC |
java.util.List<java.lang.Double> |
toDoubleList(java.lang.String col)
|
java.util.List<java.lang.Integer> |
toIntList(int columnIndex)
Returns a List of Integers for columnIndex, starting from the current row to the end. |
java.util.List<java.lang.Integer> |
toIntList(java.lang.String col)
|
java.util.List<java.lang.Integer> |
toOIDList(int columnIndex)
Returns a List of Integers (OIDs) for columnIndex, starting from the current row to the end. |
java.util.List<java.lang.Integer> |
toOIDList(java.lang.String col)
|
java.util.List<java.lang.String> |
toStringList(int columnIndex)
Returns a List of StringS for columnIndex, starting from the current row to the end. |
java.util.List<java.lang.String> |
toStringList(java.lang.String col)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected MonetStream monetStream
protected java.lang.String queryText
protected int rowNum
protected int rowCount
protected java.lang.String currentLine
protected java.util.ArrayList<java.lang.String> columnValueList
protected java.util.List<java.lang.String> resultSetLines
| Constructor Detail |
|---|
public ResultSet()
public ResultSet(MonetStream monetStream,
java.lang.String query)
monetStream - streamquery - query| Method Detail |
|---|
public boolean getBoolean(int columnIndex)
columnIndex -
public boolean getBoolean(java.lang.String col)
public char getChar(int columnIndex)
columnIndex -
public char getChar(java.lang.String col)
public java.lang.String getColumn(int i)
i -
public java.lang.String getColumn(java.lang.String col)
public int getColumnCount()
public java.util.List getColumnList()
public double getDouble(int columnIndex)
columnIndex -
public double getDouble(java.lang.String col)
public float getFloat(int columnIndex)
columnIndex -
public float getFloat(java.lang.String col)
public int getInt(int columnIndex)
columnIndex -
public int getInt(java.lang.String col)
public java.lang.String getLine()
public java.lang.String getQueryText()
public int getRowCount()
public int getOID(int columnIndex)
columnIndex -
public int getOID(java.lang.String col)
public java.lang.String getString(int columnIndex)
columnIndex -
public java.lang.String getString(java.lang.String col)
public boolean isColumnNil(int columnIndex)
columnIndex -
public boolean isColumnNil(java.lang.String col)
public boolean next()
public ResultSet setColumnNames(java.lang.String[] colNames)
colNames - public int size()
public java.util.List<java.lang.Double> toDoubleList(java.lang.String col)
public java.util.List<java.lang.Integer> toIntList(int columnIndex)
columnIndex -
public java.util.List<java.lang.Integer> toIntList(java.lang.String col)
public java.util.List<java.lang.Integer> toOIDList(int columnIndex)
columnIndex -
public java.util.List<java.lang.Integer> toOIDList(java.lang.String col)
public java.util.List<java.lang.String> toStringList(int columnIndex)
columnIndex -
public java.util.List<java.lang.String> toStringList(java.lang.String col)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||