public class SqlLobValue extends ObjectSE implements DisposableSqlTypeValue
このクラスは、更新が完了した後に閉じる必要がある LocCreator への参照を保持します。これは、closeLobCreator メソッドの呼び出しを介して行われます。LobCreator のすべての処理は、LobCreator を使用するフレームワーククラスによって行われます。このクラスのエンドユーザーのために LobCreator を設定したり閉じたりする必要はありません。
使用例:
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); // reusable object LobHandler lobHandler = new DefaultLobHandler(); // reusable object jdbcTemplate.update( "INSERT INTO imagedb (image_name, content, description) VALUES (?, ?, ?)", new Object[] { name, new SqlLobValue(contentStream, contentLength, lobHandler), new SqlLobValue(description, lobHandler) }, new int[] {Types.VARCHAR, Types.BLOB, Types.CLOB});
LobHandler
, LobCreator
, JdbcTemplate.update(String, Object[], int[])
, SqlUpdate.update(Object[])
, StoredProcedure.execute(java.util.Map)
TYPE_UNKNOWN
コンストラクターと説明 |
---|
SqlLobValue(byte[] bytes) DefaultLobHandler を使用して、指定されたバイト配列で新しい BLOB 値を作成します。 |
SqlLobValue(byte[] bytes, LobHandler lobHandler) 指定されたバイト配列で新しい BLOB 値を作成します。 |
SqlLobValue(InputStreamSE stream, int length) DefaultLobHandler を使用して、指定されたストリームで新しい BLOB/CLOB 値を作成します。 |
SqlLobValue(InputStreamSE stream, int length, LobHandler lobHandler) 指定されたストリームで新しい BLOB/CLOB 値を作成します。 |
SqlLobValue(ReaderSE reader, int length) DefaultLobHandler を使用して、指定された文字ストリームで新しい CLOB 値を作成します。 |
SqlLobValue(ReaderSE reader, int length, LobHandler lobHandler) 指定された文字ストリームで新しい CLOB 値を作成します。 |
SqlLobValue(StringSE content) DefaultLobHandler を使用して、指定されたコンテンツ文字列で新しい CLOB 値を作成します。 |
SqlLobValue(StringSE content, LobHandler lobHandler) 指定されたコンテンツ文字列で新しい CLOB 値を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | cleanup() LobCreator がある場合は閉じます。 |
void | setTypeValue(PreparedStatementSE ps, int paramIndex, int sqlType, StringSE typeName) LobCreator を介して指定されたコンテンツを設定します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public SqlLobValue(@Nullable byte[] bytes)
bytes
- BLOB 値を含むバイト配列 DefaultLobHandler
public SqlLobValue(@Nullable byte[] bytes, LobHandler lobHandler)
bytes
- BLOB 値を含むバイト配列 lobHandler
- 使用する LobHandlerpublic SqlLobValue(@Nullable StringSE content)
content
- CLOB 値を含む StringDefaultLobHandler
public SqlLobValue(@Nullable StringSE content, LobHandler lobHandler)
content
- CLOB 値を含む StringlobHandler
- 使用する LobHandlerpublic SqlLobValue(InputStreamSE stream, int length)
stream
- LOB 値を含むストリーム length
- LOB 値の長さ DefaultLobHandler
public SqlLobValue(InputStreamSE stream, int length, LobHandler lobHandler)
stream
- LOB 値を含むストリーム length
- LOB 値の長さ lobHandler
- 使用する LobHandlerpublic SqlLobValue(ReaderSE reader, int length)
reader
- CLOB 値を含む文字ストリーム length
- CLOB 値の長さ DefaultLobHandler
public SqlLobValue(ReaderSE reader, int length, LobHandler lobHandler)
reader
- CLOB 値を含む文字ストリーム length
- CLOB 値の長さ lobHandler
- 使用する LobHandlerpublic void setTypeValue(PreparedStatementSE ps, int paramIndex, int sqlType, @Nullable StringSE typeName) throws SQLExceptionSE
SqlTypeValue
の setTypeValue
ps
- PreparedStatement に取り組む paramIndex
- 値を設定する必要があるパラメーターのインデックス sqlType
- 設定するパラメーターの SQL 型 typeName
- パラメーターの型名 (オプション)SQLExceptionSE
- パラメーター値の設定中に SQLException が発生した場合 Types
SE, PreparedStatement.setObject(int, java.lang.Object, int)
SEpublic void cleanup()
DisposableSqlTypeValue
の cleanup
cleanup()
, SqlValue.cleanup()