public class BlobSerializableTypeHandler extends AbstractLobTypeHandler
Can also be defined in generic iBATIS mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be BLOB: For databases like MySQL and MS SQL Server, any large enough binary type will work.
SqlMapClientFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)
LOB_CREATOR_SYNCHRONIZATION_ORDER
Modifier | Constructor and Description |
---|---|
|
BlobSerializableTypeHandler()
Constructor used by iBATIS: fetches config-time LobHandler from
SqlMapClientFactoryBean.
|
protected |
BlobSerializableTypeHandler(LobHandler lobHandler)
Constructor used for testing: takes an explicit LobHandler.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
getResultInternal(java.sql.ResultSet rs,
int index,
LobHandler lobHandler)
Template method to extract a value from the given result set.
|
protected void |
setParameterInternal(java.sql.PreparedStatement ps,
int index,
java.lang.Object value,
java.lang.String jdbcType,
LobCreator lobCreator)
Template method to set the given value on the given statement.
|
java.lang.Object |
valueOf(java.lang.String s) |
getResult, getResult, getResult, setParameter
public BlobSerializableTypeHandler()
protected BlobSerializableTypeHandler(LobHandler lobHandler)
protected void setParameterInternal(java.sql.PreparedStatement ps, int index, java.lang.Object value, java.lang.String jdbcType, LobCreator lobCreator) throws java.sql.SQLException, java.io.IOException
AbstractLobTypeHandler
setParameterInternal
in class AbstractLobTypeHandler
ps
- the PreparedStatement to set onindex
- the statement parameter indexvalue
- the parameter value to setjdbcType
- the JDBC type of the parameterlobCreator
- the LobCreator to usejava.sql.SQLException
- if thrown by JDBC methodsjava.io.IOException
- if thrown by streaming methodsprotected java.lang.Object getResultInternal(java.sql.ResultSet rs, int index, LobHandler lobHandler) throws java.sql.SQLException, java.io.IOException
AbstractLobTypeHandler
getResultInternal
in class AbstractLobTypeHandler
rs
- the ResultSet to extract fromindex
- the index in the ResultSetlobHandler
- the LobHandler to usejava.sql.SQLException
- if thrown by JDBC methodsjava.io.IOException
- if thrown by streaming methodspublic java.lang.Object valueOf(java.lang.String s)