public class ResultSetWrappingSqlRowSet extends ObjectSE implements SqlRowSet
SqlRowSet
インターフェースのデフォルト実装。ResultSet
SE をラップし、任意の SQLExceptions
SE をキャッチして、対応する Spring InvalidResultSetAccessException
に変換します。 渡された ResultSet は、SqlRowSet が切断された方法で使用可能であると想定されている場合、すでに切断されているはずです。つまり、通常は ResultSet インターフェースを実装する javax.sql.rowset.CachedRowSet
を渡します。
メモ: JDBC 4.0 以降、文字列を使用して列を識別するメソッドでは、列ラベルを使用する必要があることが明確になりました。列ラベルは、SQL クエリ文字列で ALIAS キーワードを使用して割り当てられます。クエリで ALIAS を使用しない場合、デフォルトのラベルは列名です。ほとんどの JDBC ResultSet 実装はこの新しいパターンに従いますが、列名のみを使用し、列ラベルを無視する com.sun.rowset.CachedRowSetImpl
クラスなどの例外があります。Spring 3.0.5 の時点で、ResultSetWrappingSqlRowSet は列ラベルを正しい列インデックスに変換して、RowSets を操作するときに JdbcTemplate
によって使用されるデフォルトの実装である com.sun.rowset.CachedRowSetImpl
のサポートを改善します。
メモ: このクラスは、SqlRowSet インターフェースを介して java.io.Serializable
マーカーインターフェースを実装しますが、実際に直列化可能であるのは、それに含まれる切断された ResultSet/RowSet が直列化可能である場合のみです。ほとんどの CachedRowSet 実装は実際にはシリアライズ可能であるため、通常これでうまくいくはずです。
ResultSet
SE, CachedRowSet
SE, JdbcTemplate.queryForRowSet(java.lang.String)
, 直列化された形式 コンストラクターと説明 |
---|
ResultSetWrappingSqlRowSet(ResultSetSE resultSet) 指定された ResultSet の新しい ResultSetWrappingSqlRowSet を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
boolean | absolute(int row) 行セット内の最後の行の直後に、指定された行番号にカーソルを移動します。 |
void | afterLast() カーソルをこの行セットの最後に移動します。 |
void | beforeFirst() カーソルをこの行セットの前、最初の行の直前に移動します。 |
int | findColumn(StringSE columnLabel) 指定された列ラベルをその列インデックスにマップします。 |
boolean | first() カーソルをこの行セットの最初の行に移動します。 |
BigDecimalSE | getBigDecimal(int columnIndex) 現在の行の指定された列の値を BigDecimal オブジェクトとして取得します。 |
BigDecimalSE | getBigDecimal(StringSE columnLabel) 現在の行の指定された列の値を BigDecimal オブジェクトとして取得します。 |
boolean | getBoolean(int columnIndex) 現在行の指定された列の値をブール値として取得します。 |
boolean | getBoolean(StringSE columnLabel) 現在行の指定された列の値をブール値として取得します。 |
byte | getByte(int columnIndex) 現在行の指定された列の値をバイトとして取得します。 |
byte | getByte(StringSE columnLabel) 現在行の指定された列の値をバイトとして取得します。 |
DateSE | getDate(int columnIndex) 現在の行の指定された列の値を Date オブジェクトとして取得します。 |
DateSE | getDate(int columnIndex, CalendarSE cal) 現在の行の指定された列の値を Date オブジェクトとして取得します。 |
DateSE | getDate(StringSE columnLabel) 現在の行の指定された列の値を Date オブジェクトとして取得します。 |
DateSE | getDate(StringSE columnLabel, CalendarSE cal) 現在の行の指定された列の値を Date オブジェクトとして取得します。 |
double | getDouble(int columnIndex) 現在行の指定された列の値を Double オブジェクトとして取得します。 |
double | getDouble(StringSE columnLabel) 現在行の指定された列の値を Double オブジェクトとして取得します。 |
float | getFloat(int columnIndex) 現在の行の指定された列の値を float として取得します。 |
float | getFloat(StringSE columnLabel) 現在の行の指定された列の値を float として取得します。 |
int | getInt(int columnIndex) 現在の行の指定された列の値を int として取得します。 |
int | getInt(StringSE columnLabel) 現在の行の指定された列の値を int として取得します。 |
long | getLong(int columnIndex) 現在行の指定された列の値を long として取得します。 |
long | getLong(StringSE columnLabel) 現在行の指定された列の値を long として取得します。 |
SqlRowSetMetaData | getMetaData() メタデータを取得します。 |
StringSE | getNString(int columnIndex) 現在の行の指定された列の値を文字列として取得します(NCHAR、NVARCHAR、LONGNVARCHAR 列の場合)。 |
StringSE | getNString(StringSE columnLabel) 現在の行の指定された列の値を文字列として取得します(NCHAR、NVARCHAR、LONGNVARCHAR 列の場合)。 |
ObjectSE | getObject(int columnIndex) 現在の行の指定された列の値をオブジェクトとして取得します。 |
<T> T | getObject(int columnIndex, ClassSE<T> type) 現在の行の指定された列の値をオブジェクトとして取得します。 |
ObjectSE | getObject(int columnIndex, MapSE<StringSE, ClassSE<?>> map) 現在の行の指定された列の値をオブジェクトとして取得します。 |
ObjectSE | getObject(StringSE columnLabel) 現在の行の指定された列の値をオブジェクトとして取得します。 |
<T> T | getObject(StringSE columnLabel, ClassSE<T> type) 現在の行の指定された列の値をオブジェクトとして取得します。 |
ObjectSE | getObject(StringSE columnLabel, MapSE<StringSE, ClassSE<?>> map) 現在の行の指定された列の値をオブジェクトとして取得します。 |
ResultSetSE | getResultSet() 基本となる ResultSet(通常は javax.sql.rowset.CachedRowSet )を返します。 |
int | getRow() 現在の行番号を取得します。 |
short | getShort(int columnIndex) 現在の行の指定された列の値を short として取得します。 |
short | getShort(StringSE columnLabel) 現在の行の指定された列の値を short として取得します。 |
StringSE | getString(int columnIndex) 現在の行の指定された列の値を文字列として取得します。 |
StringSE | getString(StringSE columnLabel) 現在の行の指定された列の値を文字列として取得します。 |
TimeSE | getTime(int columnIndex) 現在の行の指定された列の値を Time オブジェクトとして取得します。 |
TimeSE | getTime(int columnIndex, CalendarSE cal) 現在の行の指定された列の値を Time オブジェクトとして取得します。 |
TimeSE | getTime(StringSE columnLabel) 現在の行の指定された列の値を Time オブジェクトとして取得します。 |
TimeSE | getTime(StringSE columnLabel, CalendarSE cal) 現在の行の指定された列の値を Time オブジェクトとして取得します。 |
TimestampSE | getTimestamp(int columnIndex) 現在の行の指定された列の値を Timestamp オブジェクトとして取得します。 |
TimestampSE | getTimestamp(int columnIndex, CalendarSE cal) 現在の行の指定された列の値を Timestamp オブジェクトとして取得します。 |
TimestampSE | getTimestamp(StringSE columnLabel) 現在の行の指定された列の値を Timestamp オブジェクトとして取得します。 |
TimestampSE | getTimestamp(StringSE columnLabel, CalendarSE cal) 現在の行の指定された列の値を Timestamp オブジェクトとして取得します。 |
boolean | isAfterLast() カーソルがこの行セットの最後の行の後にあるかどうかを取得します。 |
boolean | isBeforeFirst() カーソルがこの行セットの最初の行の前にあるかどうかを取得します。 |
boolean | isFirst() カーソルがこの行セットの最初の行にあるかどうかを取得します。 |
boolean | isLast() カーソルがこの行セットの最後の行にあるかどうかを取得します。 |
boolean | last() カーソルをこの行セットの最後の行に移動します。 |
boolean | next() カーソルを次の行に移動します。 |
boolean | previous() カーソルを前の行に移動します。 |
boolean | relative(int rows) 正または負の相対行数でカーソルを移動します。 |
boolean | wasNull() 最後に読み取られた列の値が SQL NULL であったかどうかを報告します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public ResultSetWrappingSqlRowSet(ResultSetSE resultSet) throws InvalidResultSetAccessException
resultSet
- ラップする切断された ResultSet (通常 javax.sql.rowset.CachedRowSet
)InvalidResultSetAccessException
- ResultSetMetaData の抽出に失敗した場合 CachedRowSet
SE, ResultSet.getMetaData()
SE, ResultSetWrappingSqlRowSetMetaData
public final ResultSetSE getResultSet()
javax.sql.rowset.CachedRowSet
)を返します。CachedRowSet
SEpublic final SqlRowSetMetaData getMetaData()
SqlRowSet
SqlRowSet
の getMetaData
ResultSetMetaData.getCatalogName(int)
SEpublic int findColumn(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の findColumn
columnLabel
- 列の名前 InvalidResultSetAccessException
ResultSet.findColumn(String)
SEpublic BigDecimalSE getBigDecimal(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getBigDecimal
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getBigDecimal(int)
SEpublic BigDecimalSE getBigDecimal(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getBigDecimal
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getBigDecimal(String)
SEpublic boolean getBoolean(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getBoolean
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getBoolean(int)
SEpublic boolean getBoolean(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getBoolean
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getBoolean(String)
SEpublic byte getByte(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getByte
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getByte(int)
SEpublic byte getByte(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getByte
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getByte(String)
SEpublic DateSE getDate(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getDate
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getDate(int)
SEpublic DateSE getDate(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getDate
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getDate(String)
SEpublic DateSE getDate(int columnIndex, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getDate
columnIndex
- 列インデックス cal
- 日付の作成に使用するカレンダー InvalidResultSetAccessException
ResultSet.getDate(int, Calendar)
SEpublic DateSE getDate(StringSE columnLabel, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getDate
columnLabel
- 列ラベル cal
- 日付の作成に使用するカレンダー InvalidResultSetAccessException
ResultSet.getDate(String, Calendar)
SEpublic double getDouble(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getDouble
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getDouble(int)
SEpublic double getDouble(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getDouble
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getDouble(String)
SEpublic float getFloat(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getFloat
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getFloat(int)
SEpublic float getFloat(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getFloat
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getFloat(String)
SEpublic int getInt(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getInt
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getInt(int)
SEpublic int getInt(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getInt
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getInt(String)
SEpublic long getLong(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getLong
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getLong(int)
SEpublic long getLong(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getLong
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getLong(String)
SEpublic StringSE getNString(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getNString
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getNString(int)
SEpublic StringSE getNString(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getNString
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getNString(String)
SEpublic ObjectSE getObject(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getObject
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getObject(int)
SEpublic ObjectSE getObject(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getObject
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getObject(String)
SEpublic ObjectSE getObject(int columnIndex, MapSE<StringSE,ClassSE<?>> map) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getObject
columnIndex
- 列インデックス map
- SQL 型から Java 型へのマッピングを含む Map オブジェクト InvalidResultSetAccessException
ResultSet.getObject(int, Map)
SEpublic ObjectSE getObject(StringSE columnLabel, MapSE<StringSE,ClassSE<?>> map) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getObject
columnLabel
- 列ラベル map
- SQL 型から Java 型へのマッピングを含む Map オブジェクト InvalidResultSetAccessException
ResultSet.getObject(String, Map)
SEpublic <T> T getObject(int columnIndex, ClassSE<T> type) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getObject
columnIndex
- 列インデックス type
- 指定された列を変換する Java 型 InvalidResultSetAccessException
ResultSet.getObject(int, Class)
SEpublic <T> T getObject(StringSE columnLabel, ClassSE<T> type) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getObject
columnLabel
- 列ラベル type
- 指定された列を変換する Java 型 InvalidResultSetAccessException
ResultSet.getObject(String, Class)
SEpublic short getShort(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getShort
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getShort(int)
SEpublic short getShort(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getShort
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getShort(String)
SEpublic StringSE getString(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getString
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getString(int)
SEpublic StringSE getString(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getString
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getString(String)
SEpublic TimeSE getTime(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getTime
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getTime(int)
SEpublic TimeSE getTime(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getTime
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getTime(String)
SEpublic TimeSE getTime(int columnIndex, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getTime
columnIndex
- 列インデックス cal
- 日付の作成に使用するカレンダー InvalidResultSetAccessException
ResultSet.getTime(int, Calendar)
SEpublic TimeSE getTime(StringSE columnLabel, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getTime
columnLabel
- 列ラベル cal
- 日付の作成に使用するカレンダー InvalidResultSetAccessException
ResultSet.getTime(String, Calendar)
SEpublic TimestampSE getTimestamp(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getTimestamp
columnIndex
- 列インデックス InvalidResultSetAccessException
ResultSet.getTimestamp(int)
SEpublic TimestampSE getTimestamp(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getTimestamp
columnLabel
- 列ラベル InvalidResultSetAccessException
ResultSet.getTimestamp(String)
SEpublic TimestampSE getTimestamp(int columnIndex, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getTimestamp
columnIndex
- 列インデックス cal
- 日付の作成に使用するカレンダー InvalidResultSetAccessException
ResultSet.getTimestamp(int, Calendar)
SEpublic TimestampSE getTimestamp(StringSE columnLabel, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getTimestamp
columnLabel
- 列ラベル cal
- 日付の作成に使用するカレンダー InvalidResultSetAccessException
ResultSet.getTimestamp(String, Calendar)
SEpublic boolean absolute(int row) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の absolute
row
- カーソルが移動する行の番号 true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.absolute(int)
SEpublic void afterLast() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の afterLast
InvalidResultSetAccessException
ResultSet.afterLast()
SEpublic void beforeFirst() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の beforeFirst
InvalidResultSetAccessException
ResultSet.beforeFirst()
SEpublic boolean first() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の first
true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.first()
SEpublic int getRow() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の getRow
InvalidResultSetAccessException
ResultSet.getRow()
SEpublic boolean isAfterLast() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の isAfterLast
true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.isAfterLast()
SEpublic boolean isBeforeFirst() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の isBeforeFirst
true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.isBeforeFirst()
SEpublic boolean isFirst() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の isFirst
true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.isFirst()
SEpublic boolean isLast() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の isLast
true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.isLast()
SEpublic boolean last() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の last
true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.last()
SEpublic boolean next() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の next
true
、行がもうない場合は false
InvalidResultSetAccessException
ResultSet.next()
SEpublic boolean previous() throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の previous
true
、行セットから外れている場合は false
InvalidResultSetAccessException
ResultSet.previous()
SEpublic boolean relative(int rows) throws InvalidResultSetAccessException
SqlRowSet
SqlRowSet
の relative
true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.relative(int)
SEpublic boolean wasNull() throws InvalidResultSetAccessException
SqlRowSet
NULL
であったかどうかを報告します。 最初に getter メソッドの 1 つを呼び出してから、wasNull()
メソッドを呼び出す必要があることに注意してください。
SqlRowSet
の wasNull
NULL
の場合は true
、それ以外の場合は false
InvalidResultSetAccessException
ResultSet.wasNull()
SE