@ -4355,23 +4355,24 @@ You can provide SQL type information in several ways:
@@ -4355,23 +4355,24 @@ You can provide SQL type information in several ways:
[[jdbc-lob]]
==== Handling BLOB and CLOB objects
You can store images, other binary objects, and large chunks of text. These large object
are called BLOB for binary data and CLOB for character data. In Spring you can handle
these large objects by using the JdbcTemplate directly and also when using the higher
abstractions provided by RDBMS Objects and the `SimpleJdbc` classes. All of these
approaches use an implementation of the `LobHandler` interface for the actual management
of the LOB data. The `LobHandler` provides access to a `LobCreator` class, through the
`getLobCreator` method, used for creating new LOB objects to be inserted.
You can store images, other binary data, and large chunks of text in the database. These
large objects are called BLOBs (Binary Large OBject) for binary data and CLOBs (Character
Large OBject) for character data. In Spring you can handle these large objects by using
the `JdbcTemplate` directly and also when using the higher abstractions provided by RDBMS
Objects and the `SimpleJdbc` classes. All of these approaches use an implementation of
the `LobHandler` interface for the actual management of the LOB (Large OBject) data. The
`LobHandler` provides access to a `LobCreator` class, through the `getLobCreator` method,
used for creating new LOB objects to be inserted.
The `LobCreator/LobHandler` provides the following support for LOB input and output:
* BLOB
* byte[] -- getBlobAsBytes and setBlobAsBytes
* InputStream -- getBlobAsBinaryStream and setBlobAsBinaryStream
** `byte[]` -- `getBlobAsBytes` and `setBlobAsBytes`
** `InputStream` -- `getBlobAsBinaryStream` and `setBlobAsBinaryStream`
* CLOB
* String -- getClobAsString and setClobAsString
* InputStream -- getClobAsAsciiStream and setClobAsAsciiStream
* Reader -- getClobAsCharacterStream and setClobAsCharacterStream
** `String` -- `getClobAsString` and `setClobAsString`
** `InputStream` -- `getClobAsAsciiStream` and `setClobAsAsciiStream`
** `Reader` -- `getClobAsCharacterStream` and `setClobAsCharacterStream`
The next example shows how to create and insert a BLOB. Later you will see how to read