net.hasor.jdbc
接口 SqlRowSet

所有超级接口:
Serializable
所有已知实现类:
ResultSetWrappingSqlRowSet

public interface SqlRowSet
extends Serializable

该接口是对 javax.sql.RowSet接口的一个包装,当断开连接之后通过 SqlRowSet 接口仍然可以取得数据。

作者:
Thomas Risberg, Juergen Hoeller, 赵永春(zyc@hasor.net)
另请参见:
RowSet, ResultSet

方法摘要
 boolean absolute(int row)
          Moves the cursor to the given row number in the RowSet, just after the last row.
 void afterLast()
          Moves the cursor to the end of this RowSet.
 void beforeFirst()
          Moves the cursor to the front of this RowSet, just before the first row.
 int findColumn(String columnName)
          Maps the given column name to its column index.
 boolean first()
          Moves the cursor to the first row of this RowSet.
 BigDecimal getBigDecimal(int columnIndex)
          Retrieves the value of the indicated column in the current row as an BigDecimal object.
 BigDecimal getBigDecimal(String columnName)
          Retrieves the value of the indicated column in the current row as an BigDecimal object.
 boolean getBoolean(int columnIndex)
          Retrieves the value of the indicated column in the current row as a boolean.
 boolean getBoolean(String columnName)
          Retrieves the value of the indicated column in the current row as a boolean.
 byte getByte(int columnIndex)
          Retrieves the value of the indicated column in the current row as a byte.
 byte getByte(String columnName)
          Retrieves the value of the indicated column in the current row as a byte.
 Date getDate(int columnIndex)
          Retrieves the value of the indicated column in the current row as a Date object.
 Date getDate(int columnIndex, Calendar cal)
          Retrieves the value of the indicated column in the current row as a Date object.
 Date getDate(String columnName)
          Retrieves the value of the indicated column in the current row as a Date object.
 Date getDate(String columnName, Calendar cal)
          Retrieves the value of the indicated column in the current row as a Date object.
 double getDouble(int columnIndex)
          Retrieves the value of the indicated column in the current row as a Double object.
 double getDouble(String columnName)
          Retrieves the value of the indicated column in the current row as a Double object.
 float getFloat(int columnIndex)
          Retrieves the value of the indicated column in the current row as a float.
 float getFloat(String columnName)
          Retrieves the value of the indicated column in the current row as a float.
 int getInt(int columnIndex)
          Retrieves the value of the indicated column in the current row as an int.
 int getInt(String columnName)
          Retrieves the value of the indicated column in the current row as an int.
 long getLong(int columnIndex)
          Retrieves the value of the indicated column in the current row as a long.
 long getLong(String columnName)
          Retrieves the value of the indicated column in the current row as a long.
 SqlRowSetMetaData getMetaData()
          Retrieves the meta data (number, types and properties for the columns) of this row set.
 Object getObject(int columnIndex)
          Retrieves the value of the indicated column in the current row as an Object.
 Object getObject(int columnIndex, Map map)
          Retrieves the value of the indicated column in the current row as an Object.
 Object getObject(String columnName)
          Retrieves the value of the indicated column in the current row as an Object.
 Object getObject(String columnName, Map map)
          Retrieves the value of the indicated column in the current row as an Object.
 int getRow()
          Retrieves the current row number.
 short getShort(int columnIndex)
          Retrieves the value of the indicated column in the current row as a short.
 short getShort(String columnName)
          Retrieves the value of the indicated column in the current row as a short.
 String getString(int columnIndex)
          Retrieves the value of the indicated column in the current row as a String.
 String getString(String columnName)
          Retrieves the value of the indicated column in the current row as a String.
 Time getTime(int columnIndex)
          Retrieves the value of the indicated column in the current row as a Time object.
 Time getTime(int columnIndex, Calendar cal)
          Retrieves the value of the indicated column in the current row as a Time object.
 Time getTime(String columnName)
          Retrieves the value of the indicated column in the current row as a Time object.
 Time getTime(String columnName, Calendar cal)
          Retrieves the value of the indicated column in the current row as a Time object.
 Timestamp getTimestamp(int columnIndex)
          Retrieves the value of the indicated column in the current row as a Timestamp object.
 Timestamp getTimestamp(int columnIndex, Calendar cal)
          Retrieves the value of the indicated column in the current row as a Timestamp object.
 Timestamp getTimestamp(String columnName)
          Retrieves the value of the indicated column in the current row as a Timestamp object.
 Timestamp getTimestamp(String columnName, Calendar cal)
          Retrieves the value of the indicated column in the current row as a Timestamp object.
 boolean isAfterLast()
          Retrieves whether the cursor is after the last row of this RowSet.
 boolean isBeforeFirst()
          Retrieves whether the cursor is after the first row of this RowSet.
 boolean isFirst()
          Retrieves whether the cursor is on the first row of this RowSet.
 boolean isLast()
          Retrieves whether the cursor is on the last row of this RowSet.
 boolean last()
          Moves the cursor to the last row of this RowSet.
 boolean next()
          Moves the cursor to the next row.
 boolean previous()
          Moves the cursor to the previous row.
 boolean relative(int rows)
          Moves the cursor a relative number f rows, either positive or negative.
 boolean wasNull()
          Reports whether the last column read had a value of SQL NULL.
 

方法详细信息

getMetaData

SqlRowSetMetaData getMetaData()
Retrieves the meta data (number, types and properties for the columns) of this row set.

返回:
a corresponding SqlRowSetMetaData instance
另请参见:
ResultSet.getMetaData()

findColumn

int findColumn(String columnName)
               throws InvalidDataAccessException
Maps the given column name to its column index.

参数:
columnName - the name of the column
返回:
the column index for the given column name
抛出:
InvalidDataAccessException
另请参见:
ResultSet.findColumn(String)

getBigDecimal

BigDecimal getBigDecimal(int columnIndex)
                         throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as an BigDecimal object.

参数:
columnIndex - the column index
返回:
an BigDecimal object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getBigDecimal(int)

getBigDecimal

BigDecimal getBigDecimal(String columnName)
                         throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as an BigDecimal object.

参数:
columnName - the column name
返回:
an BigDecimal object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getBigDecimal(java.lang.String)

getBoolean

boolean getBoolean(int columnIndex)
                   throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a boolean.

参数:
columnIndex - the column index
返回:
a boolean representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getBoolean(int)

getBoolean

boolean getBoolean(String columnName)
                   throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a boolean.

参数:
columnName - the column name
返回:
a boolean representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getBoolean(java.lang.String)

getByte

byte getByte(int columnIndex)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a byte.

参数:
columnIndex - the column index
返回:
a byte representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getByte(int)

getByte

byte getByte(String columnName)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a byte.

参数:
columnName - the column name
返回:
a byte representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getByte(java.lang.String)

getDate

Date getDate(int columnIndex,
             Calendar cal)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Date object.

参数:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
返回:
a Date object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getDate(int, java.util.Calendar)

getDate

Date getDate(int columnIndex)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Date object.

参数:
columnIndex - the column index
返回:
a Date object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getDate(int)

getDate

Date getDate(String columnName,
             Calendar cal)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Date object.

参数:
columnName - the column name
cal - the Calendar to use in constructing the Date
返回:
a Date object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getDate(java.lang.String, java.util.Calendar)

getDate

Date getDate(String columnName)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Date object.

参数:
columnName - the column name
返回:
a Date object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getDate(java.lang.String)

getDouble

double getDouble(int columnIndex)
                 throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Double object.

参数:
columnIndex - the column index
返回:
a Double object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getDouble(int)

getDouble

double getDouble(String columnName)
                 throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Double object.

参数:
columnName - the column name
返回:
a Double object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getDouble(java.lang.String)

getFloat

float getFloat(int columnIndex)
               throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a float.

参数:
columnIndex - the column index
返回:
a float representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getFloat(int)

getFloat

float getFloat(String columnName)
               throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a float.

参数:
columnName - the column name
返回:
a float representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getFloat(java.lang.String)

getInt

int getInt(int columnIndex)
           throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as an int.

参数:
columnIndex - the column index
返回:
an int representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getInt(int)

getInt

int getInt(String columnName)
           throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as an int.

参数:
columnName - the column name
返回:
an int representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getInt(java.lang.String)

getLong

long getLong(int columnIndex)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a long.

参数:
columnIndex - the column index
返回:
a long representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getLong(int)

getLong

long getLong(String columnName)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a long.

参数:
columnName - the column name
返回:
a long representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getLong(java.lang.String)

getObject

Object getObject(int columnIndex,
                 Map map)
                 throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as an Object.

参数:
columnIndex - the column index
map - a Map object containing the mapping from SQL types to Java types
返回:
a Object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getObject(int, java.util.Map)

getObject

Object getObject(int columnIndex)
                 throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as an Object.

参数:
columnIndex - the column index
返回:
a Object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getObject(int)

getObject

Object getObject(String columnName,
                 Map map)
                 throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as an Object.

参数:
columnName - the column name
map - a Map object containing the mapping from SQL types to Java types
返回:
a Object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getObject(java.lang.String, java.util.Map)

getObject

Object getObject(String columnName)
                 throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as an Object.

参数:
columnName - the column name
返回:
a Object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getObject(java.lang.String)

getShort

short getShort(int columnIndex)
               throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a short.

参数:
columnIndex - the column index
返回:
a short representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getShort(int)

getShort

short getShort(String columnName)
               throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a short.

参数:
columnName - the column name
返回:
a short representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getShort(java.lang.String)

getString

String getString(int columnIndex)
                 throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a String.

参数:
columnIndex - the column index
返回:
a String representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getString(int)

getString

String getString(String columnName)
                 throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a String.

参数:
columnName - the column name
返回:
a String representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getString(java.lang.String)

getTime

Time getTime(int columnIndex,
             Calendar cal)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Time object.

参数:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
返回:
a Time object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getTime(int, java.util.Calendar)

getTime

Time getTime(int columnIndex)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Time object.

参数:
columnIndex - the column index
返回:
a Time object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getTime(int)

getTime

Time getTime(String columnName,
             Calendar cal)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Time object.

参数:
columnName - the column name
cal - the Calendar to use in constructing the Date
返回:
a Time object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getTime(java.lang.String, java.util.Calendar)

getTime

Time getTime(String columnName)
             throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Time object.

参数:
columnName - the column name
返回:
a Time object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getTime(java.lang.String)

getTimestamp

Timestamp getTimestamp(int columnIndex,
                       Calendar cal)
                       throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Timestamp object.

参数:
columnIndex - the column index
cal - the Calendar to use in constructing the Date
返回:
a Timestamp object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getTimestamp(int, java.util.Calendar)

getTimestamp

Timestamp getTimestamp(int columnIndex)
                       throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Timestamp object.

参数:
columnIndex - the column index
返回:
a Timestamp object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getTimestamp(int)

getTimestamp

Timestamp getTimestamp(String columnName,
                       Calendar cal)
                       throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Timestamp object.

参数:
columnName - the column name
cal - the Calendar to use in constructing the Date
返回:
a Timestamp object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getTimestamp(java.lang.String, java.util.Calendar)

getTimestamp

Timestamp getTimestamp(String columnName)
                       throws InvalidDataAccessException
Retrieves the value of the indicated column in the current row as a Timestamp object.

参数:
columnName - the column name
返回:
a Timestamp object representing the column value
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getTimestamp(java.lang.String)

absolute

boolean absolute(int row)
                 throws InvalidDataAccessException
Moves the cursor to the given row number in the RowSet, just after the last row.

参数:
row - the number of the row where the cursor should move
返回:
true if the cursor is on the RowSet, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.absolute(int)

afterLast

void afterLast()
               throws InvalidDataAccessException
Moves the cursor to the end of this RowSet.

抛出:
InvalidDataAccessException
另请参见:
ResultSet.afterLast()

beforeFirst

void beforeFirst()
                 throws InvalidDataAccessException
Moves the cursor to the front of this RowSet, just before the first row.

抛出:
InvalidDataAccessException
另请参见:
ResultSet.beforeFirst()

first

boolean first()
              throws InvalidDataAccessException
Moves the cursor to the first row of this RowSet.

返回:
true if the cursor is on a valid row, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.first()

getRow

int getRow()
           throws InvalidDataAccessException
Retrieves the current row number.

返回:
the current row number
抛出:
InvalidDataAccessException
另请参见:
ResultSet.getRow()

isAfterLast

boolean isAfterLast()
                    throws InvalidDataAccessException
Retrieves whether the cursor is after the last row of this RowSet.

返回:
true if the cursor is after the last row, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.isAfterLast()

isBeforeFirst

boolean isBeforeFirst()
                      throws InvalidDataAccessException
Retrieves whether the cursor is after the first row of this RowSet.

返回:
true if the cursor is after the first row, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.isBeforeFirst()

isFirst

boolean isFirst()
                throws InvalidDataAccessException
Retrieves whether the cursor is on the first row of this RowSet.

返回:
true if the cursor is after the first row, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.isFirst()

isLast

boolean isLast()
               throws InvalidDataAccessException
Retrieves whether the cursor is on the last row of this RowSet.

返回:
true if the cursor is after the last row, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.isLast()

last

boolean last()
             throws InvalidDataAccessException
Moves the cursor to the last row of this RowSet.

返回:
true if the cursor is on a valid row, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.last()

next

boolean next()
             throws InvalidDataAccessException
Moves the cursor to the next row.

返回:
true if the new row is valid, false if there are no more rows
抛出:
InvalidDataAccessException
另请参见:
ResultSet.next()

previous

boolean previous()
                 throws InvalidDataAccessException
Moves the cursor to the previous row.

返回:
true if the new row is valid, false if it is off the RowSet
抛出:
InvalidDataAccessException
另请参见:
ResultSet.previous()

relative

boolean relative(int rows)
                 throws InvalidDataAccessException
Moves the cursor a relative number f rows, either positive or negative.

返回:
true if the cursor is on a row, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.relative(int)

wasNull

boolean wasNull()
                throws InvalidDataAccessException
Reports whether the last column read had a value of SQL NULL. Note that you must first call one of the getter methods and then call the wasNull method.

返回:
true if the most recent coumn retrieved was SQL NULL, false otherwise
抛出:
InvalidDataAccessException
另请参见:
ResultSet.wasNull()


Copyright © 2013-2014. All Rights Reserved.