|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.util.SQLQueryResult
public class SQLQueryResult
This class performs a SQL (SELECT) query and provides access to the result set.
| Nested Class Summary | |
|---|---|
class |
SQLQueryResult.Row
This class represents a row. |
| Field Summary | |
|---|---|
protected java.lang.String[] |
columnNames
|
protected int |
errorCode
|
protected java.lang.String |
errorMessage
|
protected boolean |
isError
|
static java.lang.String |
REVISION
|
protected java.util.List |
rowList
|
protected java.lang.String |
sqlQuery
|
protected java.lang.String |
sqlState
|
| Constructor Summary | |
|---|---|
SQLQueryResult(java.sql.Connection conn,
java.lang.String sqlQuery,
java.lang.Object[] params,
int maxRows)
Constructs a new SQLQueryResult. |
|
SQLQueryResult(java.sql.ResultSet rs)
Constructs a new SQLQueryResult. |
|
SQLQueryResult(java.lang.String dataSource,
java.lang.String sqlQuery,
int maxRows)
Constructs a new SQLQueryResult. |
|
SQLQueryResult(java.lang.String dataSource,
java.lang.String sqlQuery,
java.lang.Object[] params,
int maxRows)
Constructs a new SQLQueryResult. |
|
SQLQueryResult(java.lang.String dataSource,
java.lang.String select,
java.lang.String from,
java.lang.String orderby,
java.lang.String[] whereParams,
java.lang.String[] whereValues,
boolean and,
int maxRows)
Constructs a new SQLQueryResult. |
|
| Method Summary | |
|---|---|
int |
getColumnCount()
Returns the column count |
java.lang.String[] |
getColumnNames()
Returns the column names |
int |
getErrorCode()
Returns the error code |
java.lang.String |
getErrorMessage()
Returns the error message |
int |
getRowCount()
Returns the count of rows. |
java.util.List |
getRowList()
Returns the list of rows. |
java.lang.String |
getSQLQuery()
Returns the error sqlQuery |
java.lang.String |
getSQLState()
Returns the SQL state |
boolean |
isEmpty()
Returns true if no result |
boolean |
isError()
Returns true if an error occured during the query process |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String REVISION
protected java.lang.String[] columnNames
protected java.util.List rowList
protected boolean isError
protected java.lang.String errorMessage
protected int errorCode
protected java.lang.String sqlState
protected java.lang.String sqlQuery
| Constructor Detail |
|---|
public SQLQueryResult(java.lang.String dataSource,
java.lang.String select,
java.lang.String from,
java.lang.String orderby,
java.lang.String[] whereParams,
java.lang.String[] whereValues,
boolean and,
int maxRows)
dataSource - the name of the data source (eg. "jdbc/TestDB")select - the table filed to select or *from - the table name to work with.orderby - the order by parameterwhereParams - an array of parameterswhereValues - an array of parameters valueand - should be 'AND' or 'OR' between parametersmaxRows - the max rows limit; zero means there is no limit
public SQLQueryResult(java.lang.String dataSource,
java.lang.String sqlQuery,
int maxRows)
dataSource - the name of the data source (eg. "jdbc/TestDB")sqlQuery - the SQL (SELECT) querymaxRows - the max rows limit; zero means there is no limit
public SQLQueryResult(java.lang.String dataSource,
java.lang.String sqlQuery,
java.lang.Object[] params,
int maxRows)
dataSource - the name of the data source (eg. "jdbc/TestDB")sqlQuery - the SQL query (may be a parametrized SQL query)params - the query parametersmaxRows - the max rows limit; zero means there is no limit
public SQLQueryResult(java.sql.Connection conn,
java.lang.String sqlQuery,
java.lang.Object[] params,
int maxRows)
conn - the JDBC connectionsqlQuery - the SQL query (may be a parametrized SQL query)params - the query parametersmaxRows - the max rows limit; zero means there is no limitpublic SQLQueryResult(java.sql.ResultSet rs)
rs - a JDBC ResultSet| Method Detail |
|---|
public java.lang.String[] getColumnNames()
public int getColumnCount()
public boolean isEmpty()
public java.util.List getRowList()
public int getRowCount()
public boolean isError()
public int getErrorCode()
SQLException.getErrorCode()public java.lang.String getSQLQuery()
public java.lang.String getErrorMessage()
public java.lang.String getSQLState()
SQLException.getSQLState()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||