public class ResultSetWrappingSqlRowSet extends ObjectSE implements SqlRowSet
SqlRowSet インターフェースのデフォルト実装。ResultSetSE をラップし、任意の SQLExceptionsSE をキャッチして、対応する 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 実装は実際にはシリアライズ可能であるため、通常これでうまくいくはずです。
ResultSetSE, CachedRowSetSE, 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, waitSEpublic ResultSetWrappingSqlRowSet(ResultSetSE resultSet) throws InvalidResultSetAccessException
resultSet - ラップする切断された ResultSet (通常 javax.sql.rowset.CachedRowSet)InvalidResultSetAccessException - ResultSetMetaData の抽出に失敗した場合 CachedRowSetSE, ResultSet.getMetaData()SE, ResultSetWrappingSqlRowSetMetaDatapublic final ResultSetSE getResultSet()
javax.sql.rowset.CachedRowSet)を返します。CachedRowSetSEpublic final SqlRowSetMetaData getMetaData()
SqlRowSetSqlRowSet の getMetaData ResultSetMetaData.getCatalogName(int)SEpublic int findColumn(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の findColumn columnLabel - 列の名前 InvalidResultSetAccessExceptionResultSet.findColumn(String)SE@Nullable public BigDecimalSE getBigDecimal(int columnIndex) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getBigDecimal columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getBigDecimal(int)SE@Nullable public BigDecimalSE getBigDecimal(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getBigDecimal columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getBigDecimal(String)SEpublic boolean getBoolean(int columnIndex)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の getBoolean columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getBoolean(int)SEpublic boolean getBoolean(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getBoolean columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getBoolean(String)SEpublic byte getByte(int columnIndex)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の getByte columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getByte(int)SEpublic byte getByte(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getByte columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getByte(String)SE@Nullable public DateSE getDate(int columnIndex) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getDate columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getDate(int)SE@Nullable public DateSE getDate(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getDate columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getDate(String)SE@Nullable public DateSE getDate(int columnIndex, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getDate columnIndex - 列インデックス cal - 日付の作成に使用するカレンダー InvalidResultSetAccessExceptionResultSet.getDate(int, Calendar)SE@Nullable public DateSE getDate(StringSE columnLabel, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getDate columnLabel - 列ラベル cal - 日付の作成に使用するカレンダー InvalidResultSetAccessExceptionResultSet.getDate(String, Calendar)SEpublic double getDouble(int columnIndex)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の getDouble columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getDouble(int)SEpublic double getDouble(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getDouble columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getDouble(String)SEpublic float getFloat(int columnIndex)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の getFloat columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getFloat(int)SEpublic float getFloat(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getFloat columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getFloat(String)SEpublic int getInt(int columnIndex)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の getInt columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getInt(int)SEpublic int getInt(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getInt columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getInt(String)SEpublic long getLong(int columnIndex)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の getLong columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getLong(int)SEpublic long getLong(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getLong columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getLong(String)SE@Nullable public StringSE getNString(int columnIndex) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getNString columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getNString(int)SE@Nullable public StringSE getNString(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getNString columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getNString(String)SE@Nullable public ObjectSE getObject(int columnIndex) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getObject columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getObject(int)SE@Nullable public ObjectSE getObject(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getObject columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getObject(String)SE@Nullable public ObjectSE getObject(int columnIndex, MapSE<StringSE,ClassSE<?>> map) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getObject columnIndex - 列インデックス map - SQL 型から Java 型へのマッピングを含む Map オブジェクト InvalidResultSetAccessExceptionResultSet.getObject(int, Map)SE@Nullable public ObjectSE getObject(StringSE columnLabel, MapSE<StringSE,ClassSE<?>> map) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getObject columnLabel - 列ラベル map - SQL 型から Java 型へのマッピングを含む Map オブジェクト InvalidResultSetAccessExceptionResultSet.getObject(String, Map)SE@Nullable public <T> T getObject(int columnIndex, ClassSE<T> type) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getObject columnIndex - 列インデックス type - 指定された列を変換する Java 型 InvalidResultSetAccessExceptionResultSet.getObject(int, Class)SE@Nullable public <T> T getObject(StringSE columnLabel, ClassSE<T> type) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getObject columnLabel - 列ラベル type - 指定された列を変換する Java 型 InvalidResultSetAccessExceptionResultSet.getObject(String, Class)SEpublic short getShort(int columnIndex)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の getShort columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getShort(int)SEpublic short getShort(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getShort columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getShort(String)SE@Nullable public StringSE getString(int columnIndex) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getString columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getString(int)SE@Nullable public StringSE getString(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getString columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getString(String)SE@Nullable public TimeSE getTime(int columnIndex) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getTime columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getTime(int)SE@Nullable public TimeSE getTime(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getTime columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getTime(String)SE@Nullable public TimeSE getTime(int columnIndex, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getTime columnIndex - 列インデックス cal - 日付の作成に使用するカレンダー InvalidResultSetAccessExceptionResultSet.getTime(int, Calendar)SE@Nullable public TimeSE getTime(StringSE columnLabel, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getTime columnLabel - 列ラベル cal - 日付の作成に使用するカレンダー InvalidResultSetAccessExceptionResultSet.getTime(String, Calendar)SE@Nullable public TimestampSE getTimestamp(int columnIndex) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getTimestamp columnIndex - 列インデックス InvalidResultSetAccessExceptionResultSet.getTimestamp(int)SE@Nullable public TimestampSE getTimestamp(StringSE columnLabel) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getTimestamp columnLabel - 列ラベル InvalidResultSetAccessExceptionResultSet.getTimestamp(String)SE@Nullable public TimestampSE getTimestamp(int columnIndex, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getTimestamp columnIndex - 列インデックス cal - 日付の作成に使用するカレンダー InvalidResultSetAccessExceptionResultSet.getTimestamp(int, Calendar)SE@Nullable public TimestampSE getTimestamp(StringSE columnLabel, CalendarSE cal) throws InvalidResultSetAccessException
SqlRowSetSqlRowSet の getTimestamp columnLabel - 列ラベル cal - 日付の作成に使用するカレンダー InvalidResultSetAccessExceptionResultSet.getTimestamp(String, Calendar)SEpublic boolean absolute(int row)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の absolute row - カーソルが移動する行の番号 true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.absolute(int)SEpublic void afterLast()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の afterLast InvalidResultSetAccessExceptionResultSet.afterLast()SEpublic void beforeFirst()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の beforeFirst InvalidResultSetAccessExceptionResultSet.beforeFirst()SEpublic boolean first()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の first true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.first()SEpublic int getRow()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の getRow InvalidResultSetAccessExceptionResultSet.getRow()SEpublic boolean isAfterLast()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の isAfterLast true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.isAfterLast()SEpublic boolean isBeforeFirst()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の isBeforeFirst true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.isBeforeFirst()SEpublic boolean isFirst()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の isFirst true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.isFirst()SEpublic boolean isLast()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の isLast true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.isLast()SEpublic boolean last()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の last true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.last()SEpublic boolean next()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の next true、行がもうない場合は false InvalidResultSetAccessExceptionResultSet.next()SEpublic boolean previous()
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の previous true、行セットから外れている場合は false InvalidResultSetAccessExceptionResultSet.previous()SEpublic boolean relative(int rows)
throws InvalidResultSetAccessExceptionSqlRowSetSqlRowSet の relative true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.relative(int)SEpublic boolean wasNull()
throws InvalidResultSetAccessExceptionSqlRowSetNULL であったかどうかを報告します。 最初に getter メソッドの 1 つを呼び出してから、wasNull() メソッドを呼び出す必要があることに注意してください。
SqlRowSet の wasNull NULL の場合は true、それ以外の場合は false InvalidResultSetAccessExceptionResultSet.wasNull()SE