public class SQLQueryResult
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
SQLQueryResult.Row
This class represents a row.
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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
|
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
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 limitpublic 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 limitpublic 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 limitpublic 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 ResultSetpublic 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()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.