クラス AbstractSqlTypeValue
java.lang.ObjectSE
org.springframework.jdbc.core.support.AbstractSqlTypeValue
- 実装されたすべてのインターフェース:
SqlTypeValue
PreparedStatement.setObject
メソッドに渡されることになっている型値の便利な作成のための SqlTypeValue インターフェースの抽象的な実装。データベース固有のオブジェクトを作成するために必要な場合は、createTypeValue
コールバックメソッドが基になる接続にアクセスできます。StoredProcedure の使用例(これをスーパークラス javadoc のプレーン SqlTypeValue バージョンと比較してください):
proc.declareParameter(new SqlParameter("myarray", Types.ARRAY, "NUMBERS")); ... Map<String, Object> in = new HashMap<String, Object>(); in.put("myarray", new AbstractSqlTypeValue() { public Object createTypeValue(Connection con, int sqlType, String typeName) throws SQLException { oracle.sql.ArrayDescriptor desc = new oracle.sql.ArrayDescriptor(typeName, con); return new oracle.sql.ARRAY(desc, con, seats); } }); Map out = execute(in);
- 導入:
- 1.1
- 作成者:
- Juergen Hoeller
- 関連事項:
フィールドサマリー
インターフェース org.springframework.jdbc.core.SqlTypeValue から継承されたフィールド
TYPE_UNKNOWN
コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明protected abstract ObjectSE
createTypeValue
(ConnectionSE con, int sqlType, StringSE typeName) PreparedStatement.setObject
に渡される型値を作成します。final void
setTypeValue
(PreparedStatementSE ps, int paramIndex, int sqlType, StringSE typeName) 指定された PreparedStatement に型値を設定します。
コンストラクターの詳細
AbstractSqlTypeValue
public AbstractSqlTypeValue()
メソッドの詳細
setTypeValue
public final void setTypeValue(PreparedStatementSE ps, int paramIndex, int sqlType, @Nullable StringSE typeName) throws SQLExceptionSE インターフェースからコピーされた説明:SqlTypeValue
指定された PreparedStatement に型値を設定します。- 次で指定:
- インターフェース
SqlTypeValue
のsetTypeValue
- パラメーター:
ps
- PreparedStatement に取り組むparamIndex
- 値を設定する必要があるパラメーターのインデックスsqlType
- 設定するパラメーターの SQL 型typeName
- パラメーターの型名 (オプション)- 例外:
SQLExceptionSE
- パラメーター値の設定中に SQLException が発生した場合- 関連事項:
createTypeValue
protected abstract ObjectSE createTypeValue(ConnectionSE con, int sqlType, @Nullable StringSE typeName) throws SQLExceptionSE PreparedStatement.setObject
に渡される型値を作成します。- パラメーター:
con
- データベース固有のオブジェクトを作成する必要がある場合は、JDBC 接続sqlType
- 設定するパラメーターの SQL 型typeName
- パラメーターの型名- 戻り値:
- 型値
- 例外:
SQLExceptionSE
- パラメーター値の設定で SQLException が発生した場合 (つまり、SQLException をキャッチする必要はありません。)- 関連事項: