|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.data.spreadsheet.SqlUtils.Reader
public static class SqlUtils.Reader
For reading data from a database.
| Field Summary | |
|---|---|
protected boolean |
m_Finished
indicates whether the reading has finished. |
protected SpreadSheet |
m_Header
the header. |
protected Class |
m_RowClass
the row class to use. |
protected boolean |
m_Stopped
whether the reading was stopped. |
protected int[] |
m_Type
the column types. |
| Constructor Summary | |
|---|---|
SqlUtils.Reader(Class rowClass)
Initializes the reader. |
|
| Method Summary | |
|---|---|
SpreadSheet |
getHeader()
Returns the current header. |
Class |
getRowClass()
Returns the row class in use. |
void |
initHeader(ResultSet rs)
Initializes the header |
boolean |
isFinished()
Returns whether the reader has finished reading data. |
boolean |
isStopped()
Returns whether the reader has been stopped. |
SpreadSheet |
read(ResultSet rs)
Reads all the data from the provided result set. |
SpreadSheet |
read(ResultSet rs,
int max)
Reads the data from the provided result set, up to the specified maximum of rows. |
void |
stopExecution()
Stops the execution. |
| Methods inherited from class adams.core.ConsoleObject |
|---|
getDebugging, getSystemErr, getSystemOut, sizeOf |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Class m_RowClass
protected boolean m_Finished
protected boolean m_Stopped
protected SpreadSheet m_Header
protected int[] m_Type
| Constructor Detail |
|---|
public SqlUtils.Reader(Class rowClass)
rowClass - the class for the rows in the spreadsheet,
e.g. DenseDataRow| Method Detail |
|---|
public void initHeader(ResultSet rs)
throws SQLException
rs - the resultset to use as basis
SQLException - if accessing of meta-data failspublic Class getRowClass()
public SpreadSheet getHeader()
initHeader(ResultSet)
public SpreadSheet read(ResultSet rs)
throws SQLException
rs - the result set to turn into a spreadsheet
SQLException - if reading fails
public SpreadSheet read(ResultSet rs,
int max)
throws SQLException
rs - the result set to turn into a spreadsheetmax - the maximum number of rows to read, 0 or less means all
SQLException - if reading failspublic void stopExecution()
stopExecution in interface Stoppablepublic boolean isStopped()
public boolean isFinished()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||