oracle数据库:
<bean id="SessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="/teach-hibernate.cfg.xml"/>
<property name="lobHandler">
<ref bean="oracleLobHandler"/>
</property>
</bean>
<!-- use spring+hibernate handle oracle BLOB-->
<bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"/>
<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true">
<property name="nativeJdbcExtractor">
<ref bean="nativeJdbcExtractor"/>
</property>
</bean>
其他数据库:
<bean id="cms.SessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="/teach-hibernate.cfg.xml"/>
<property name="lobHandler"><ref bean="lobHandler" /></property>
</bean>
<!-- use spring+hibernate handle others dbs BLOB-->
<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true"/>