how to save BLOB using hibernate and spring.
i dont want to use AOP.
how to save BLOB using hibernate and spring.
i dont want to use AOP.
How you do it mainly depends on DB you are using and our pool.
In SessionFactoryBean you have property lobHandler and you need to inject proper implementation for your DB/DataSource.
For oracle and c3p0 this works:
for oracle on websphere dataSource:Code:<bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true"> <property name="nativeJdbcExtractor"> <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.C3P0NativeJdbcExtractor"/> </property> </bean> </beans>
Code:<bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true"> <property name="nativeJdbcExtractor"> <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor"/> </property> </bean>
Hi,
I am trying to add a PDF into a table with column BLOB type, the size of the pdf is greater than 4000 bytes and it fails.
Gives an error message saying that it is exceeding maximum size.
I am using ojdbc14.jar for Oracle 10.2.0.4 version.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@<testip>:1522:<schema>" />
<property name="username" value="user" />
<property name="password" value="passwd" />
</bean>
<bean id="sqlMap" class="org.springframework.orm.ibatis.SqlMapClient FactoryBean">
<property name="configLocation" value="classpath:config/SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>
</beans>
Tried to put the line
<property name="Driver.SetBigStringTryClob" value="true" />
under dataSource bean and it gives error that Driver class cannot be found.
Please help.