|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaWebGen.data.DbResult
public final class DbResult
class that provides a way of saving metadata Data from an SQL query for the data objects without using any Data base resources(ie an open connection)
Constructor Summary | |
---|---|
DbResult(java.util.ArrayList<java.lang.Object[]> list,
java.lang.String[] colNames,
int[] types)
builds a DbResult Object by passing in a Array List of Object arrays containing the results of a SQL statement and a list of column names in the table and a array of column types SQL.TYPES |
|
DbResult(java.lang.Exception e)
creates an object storing an error message |
Method Summary | |
---|---|
java.lang.Object[] |
get(int row)
get a row of data |
java.lang.Object |
getByName(int row,
java.lang.String name)
get a row of data |
int |
getColType(int index)
get the column type |
java.lang.String |
getError()
get the error message of running the query null if no errors |
java.util.ArrayList<java.lang.Object[]> |
getList()
return all the rows in the result set |
java.lang.String[] |
getNames()
get column names |
void |
setColName(java.lang.String name,
int index)
change the column name if the index is out of range it will not change anything |
void |
setError(java.lang.String msg)
return all the rows int the result set |
int |
size()
return number of rows in results |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DbResult(java.util.ArrayList<java.lang.Object[]> list, java.lang.String[] colNames, int[] types)
list
- of Object arrays containing the results of a querycolNames
- column Namestypes
- of columnsDAO.runQuery(java.sql.Connection, java.lang.String)
public DbResult(java.lang.Exception e)
e
- exceptionMethod Detail |
---|
public java.lang.Object[] get(int row)
row
- number
public java.lang.Object getByName(int row, java.lang.String name) throws DBException
row
- numbername
- column
DBException
public java.lang.String[] getNames()
public int size()
public void setColName(java.lang.String name, int index)
name
- column nameindex
- public java.util.ArrayList<java.lang.Object[]> getList()
public java.lang.String getError()
public void setError(java.lang.String msg)
msg
- error messagepublic int getColType(int index)
index
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |