ibatis操作blob

1、pojo类中

public byte[] cont;

 

2、sqlmap中

    <result property="cont" column="cont"  typeHandler="org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler"/>

 

3、spring.xml

 <bean id="lobHandler"
  class="org.springframework.jdbc.support.lob.DefaultLobHandler"
  lazy-init="true" />

 <bean id="sqlMapClient"
  class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
  <property name="configLocation" value="classpath:sqlmap.xml" />
  <property name="dataSource" ref="dataSource" />
  <property name="lobHandler" ref="lobHandler" />
 </bean>

你可能感兴趣的:(ibatis)