ibatis Clob对象处理

Spring配置文件:

<beans>

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"

destroy-method="close">

<property name="driverClassName" value="${jdbc.driver}" />

<property name="url" value="${jdbc.url}" />

<property name="username" value="${jdbc.user}" />

<property name="password" value="${jdbc.pwd}" />

<property name="maxActive" value="30" />

<property name="maxIdle" value="30" />

<property name="maxWait" value="10000" />

<property name="logAbandoned" value="true" />

<property name="removeAbandoned" value="true" />

<property name="removeAbandonedTimeout" value="150" />

<property name="testWhileIdle" value="true" />

<property name="timeBetweenEvictionRunsMillis" value="300000" />

<property name="minEvictableIdleTimeMillis" value="320000" />

</bean>

<bean id="nativeJdbcExtractor"

class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"

lazy-init="true" />

<!-- Oracle Lob(大对象) -->

<bean id="oracleLobHandle" class="org.springframework.jdbc.support.lob.OracleLobHandler"

lazy-init="true">

<property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />

</bean>

<!--SqlMapClientFactoryBean -->

<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">

<property name="configLocation">

<value>classpath:resource/SqlMapConfig.xml</value>

</property>

<property name="lobHandler" ref="oracleLobHandle" />

<property name="dataSource">

<ref bean="dataSource" />

</property>

</bean>

<beans>

Ibatis配置文件:

<sqlMapConfig>

<typeHandler jdbcType="CLOB" javaType="java.lang.String"

callback="org.springframework.orm.ibatis.support.ClobStringTypeHandler" />

<sqlMap resource="resource/ibatis/system/Dict.xml" />

</sqlMapConfig>



你可能感兴趣的:(ibatis,Clob对象处理)