Class AbstractLobHandler
java.lang.Object
org.springframework.jdbc.support.lob.AbstractLobHandler
- All Implemented Interfaces:
LobHandler
- Direct Known Subclasses:
DefaultLobHandler
Abstract base class for
LobHandler
implementations.
Implements all accessor methods for column names through a column lookup and delegating to the corresponding accessor that takes a column index.
- Since:
- 1.2
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBlobAsBinaryStream
(ResultSet rs, String columnName) Retrieve the given column as binary stream from the given ResultSet.byte[]
getBlobAsBytes
(ResultSet rs, String columnName) Retrieve the given column as bytes from the given ResultSet.getClobAsAsciiStream
(ResultSet rs, String columnName) Retrieve the given column as ASCII stream from the given ResultSet.getClobAsCharacterStream
(ResultSet rs, String columnName) Retrieve the given column as character stream from the given ResultSet.getClobAsString
(ResultSet rs, String columnName) Retrieve the given column as String from the given ResultSet.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.jdbc.support.lob.LobHandler
getBlobAsBinaryStream, getBlobAsBytes, getClobAsAsciiStream, getClobAsCharacterStream, getClobAsString, getLobCreator
-
Constructor Details
-
AbstractLobHandler
public AbstractLobHandler()
-
-
Method Details
-
getBlobAsBytes
Description copied from interface:LobHandler
Retrieve the given column as bytes from the given ResultSet. Might simply invokeResultSet.getBytes
or work withResultSet.getBlob
, depending on the database and driver.- Specified by:
getBlobAsBytes
in interfaceLobHandler
- Parameters:
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to use- Returns:
- the content as byte array, or
null
in case of SQL NULL - Throws:
SQLException
- if thrown by JDBC methods- See Also:
-
getBlobAsBinaryStream
@Nullable public InputStream getBlobAsBinaryStream(ResultSet rs, String columnName) throws SQLException Description copied from interface:LobHandler
Retrieve the given column as binary stream from the given ResultSet. Might simply invokeResultSet.getBinaryStream
or work withResultSet.getBlob
, depending on the database and driver.- Specified by:
getBlobAsBinaryStream
in interfaceLobHandler
- Parameters:
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to use- Returns:
- the content as binary stream, or
null
in case of SQL NULL - Throws:
SQLException
- if thrown by JDBC methods- See Also:
-
getClobAsString
Description copied from interface:LobHandler
Retrieve the given column as String from the given ResultSet. Might simply invokeResultSet.getString
or work withResultSet.getClob
, depending on the database and driver.- Specified by:
getClobAsString
in interfaceLobHandler
- Parameters:
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to use- Returns:
- the content as String, or
null
in case of SQL NULL - Throws:
SQLException
- if thrown by JDBC methods- See Also:
-
getClobAsAsciiStream
@Nullable public InputStream getClobAsAsciiStream(ResultSet rs, String columnName) throws SQLException Description copied from interface:LobHandler
Retrieve the given column as ASCII stream from the given ResultSet. Might simply invokeResultSet.getAsciiStream
or work withResultSet.getClob
, depending on the database and driver.- Specified by:
getClobAsAsciiStream
in interfaceLobHandler
- Parameters:
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to use- Returns:
- the content as ASCII stream, or
null
in case of SQL NULL - Throws:
SQLException
- if thrown by JDBC methods- See Also:
-
getClobAsCharacterStream
Description copied from interface:LobHandler
Retrieve the given column as character stream from the given ResultSet. Might simply invokeResultSet.getCharacterStream
or work withResultSet.getClob
, depending on the database and driver.- Specified by:
getClobAsCharacterStream
in interfaceLobHandler
- Parameters:
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to use- Returns:
- the content as character stream
- Throws:
SQLException
- if thrown by JDBC methods- See Also:
-