ua.gradsoft.xwikisql
Interface SqlResult

All Superinterfaces:
java.util.Enumeration<SqlResultRow>, SqlErrorable
All Known Implementing Classes:
InMemorySqlResult

public interface SqlResult
extends java.util.Enumeration<SqlResultRow>, SqlErrorable

Assess object for results of query execution. Object can be


Method Summary
 int getColumnIndex(java.lang.String name)
          retrieve column index by name;
 java.lang.String getColumnName(int index)
          get column name if one exists, otherwise handle error.
 java.lang.String getColumnType(int index)
          retrieve name of column type by column index,
 java.lang.String getColumnType(java.lang.String name)
          retrieve name of column type by column name, as specified in java.sql.Types
 int getColumnTypeAsInt(int index)
          retrieve int value of column type by index,
 int getColumnTypeAsInt(java.lang.String name)
          retrieve int value of column type by name, as specified in java.sql.Types
 int getNColumns()
          get number of columns
 int getNRows()
          get number of rows.
 boolean hasColumnName(java.lang.String name)
          check if name is one of column names.
 boolean isNotAllRows()
          Indicate situation, where we does not retrieve all rows.
 
Methods inherited from interface java.util.Enumeration
hasMoreElements, nextElement
 
Methods inherited from interface ua.gradsoft.xwikisql.SqlErrorable
clearError, getLastException, getLogEnabled, getThrowExceptions, handleError, setLastException, setLogEnabled, setThrowExceptions, wasError
 

Method Detail

getNColumns

int getNColumns()
get number of columns

Returns:
number of colums.

getNRows

int getNRows()
get number of rows.

Returns:
number of rows.

isNotAllRows

boolean isNotAllRows()
Indicate situation, where we does not retrieve all rows. (for example, when select statement return us more than configurated maximumRows)

Returns:
true, if not all rows retrieced into sql result, otherwise false.

getColumnName

java.lang.String getColumnName(int index)
get column name if one exists, otherwise handle error.

Parameters:
index - (starting from 0)
Returns:
name of appropriative column.

hasColumnName

boolean hasColumnName(java.lang.String name)
check if name is one of column names.

Parameters:
name - to check.
Returns:
true if name is really a column name.

getColumnIndex

int getColumnIndex(java.lang.String name)
retrieve column index by name;

Returns:
columnIndex (started from 0) or -1 if such name is not exists.

getColumnTypeAsInt

int getColumnTypeAsInt(java.lang.String name)
retrieve int value of column type by name, as specified in java.sql.Types

Parameters:
name - - colum name.
Returns:
type of colum as int (or null)
See Also:
Types

getColumnTypeAsInt

int getColumnTypeAsInt(int index)
retrieve int value of column type by index,

Parameters:
index - - index of column (starting from 0)
Returns:
type of colum as int (or null)

getColumnType

java.lang.String getColumnType(java.lang.String name)
retrieve name of column type by column name, as specified in java.sql.Types

Parameters:
name - - colum name.
Returns:
typename
See Also:
Types

getColumnType

java.lang.String getColumnType(int index)
retrieve name of column type by column index,

Parameters:
index - - index of column (starting from 0)
Returns:
column type as string.
See Also:
Types