`

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>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics