忘记是从哪里转载来的了……
sqlMapConfig.xml中增加配置:
<!-- 操作blob数据所需配置 -->
<typeHandler jdbcType="BLOB" javaType="[B"
callback="org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler" />
applicationContext.xml中增加配置:
<!-- 操作blob数据所需配置 -->
<bean id="nativeJdbcExtractor"
class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"
lazy-init="true" />
<bean id="oracleLobHandler"
class="org.springframework.jdbc.support.lob.OracleLobHandler"
lazy-init="true">
<property name="nativeJdbcExtractor">
<ref local="nativeJdbcExtractor" />
</property>
</bean>
<!-- 外网理赔报案系统的sqlMapClient -->
<bean id="sqlMapClientLJ"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="configLocation">
<value>classpath:sqlMapConfig.xml</value>
</property>
<!-- blob数据配置 -->
<property name="lobHandler">
<ref local="oracleLobHandler" />
</property>
</bean>
本文转自 winters1224 51CTO博客,原文链接:http://blog.51cto.com/winters1224/797763,如需转载请自行联系原作者