org.springframework.dao.InvalidDataAccessApiUsageException: OracleLobCreator needs to work on [oracl
2014-12-01 20:06
489 查看
org.springframework.dao.InvalidDataAccessApiUsageException: OracleLobCreator needs to work on[oracle.jdbc.OracleConnection], not on[com.mchange.v2.c3p0.impl.NewProxyConnection]: specify a correspondingNativeJdbcExtractor;
nested exception is java.lang.ClassCastException: com.mchange.v2.c3p0.impl.NewProxyConnectioncannot be cast to oracle.jdbc.OracleConnection
at
SSH框架,在向oracle11g中插入图片时提示信息。
图片为byte[]对应数据库中的blob字段,错误原因是oracle版本问题,不同的版本处理方式不同。
oracle9的处理方式:
oracle11的处理方式:
其他点不再赘述
nested exception is java.lang.ClassCastException: com.mchange.v2.c3p0.impl.NewProxyConnectioncannot be cast to oracle.jdbc.OracleConnection
at
SSH框架,在向oracle11g中插入图片时提示信息。
图片为byte[]对应数据库中的blob字段,错误原因是oracle版本问题,不同的版本处理方式不同。
oracle9的处理方式:
<bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor" lazy-init="true" /> <bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true"> <property name="nativeJdbcExtractor"> <ref bean="nativeJdbcExtractor" /> </property> </bean>
oracle11的处理方式:
<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true" />
其他点不再赘述
相关文章推荐
- org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: sys.entity.Role; nested exception is org.hibernate.PersistentObjectException: 的解决方案
- An exception occurred: org.springframework.dao.InvalidDataAccessApiUsageException
- org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identifier:
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER)
- org.springframework.dao.InvalidDataAccessApiUsageException:The given object has a null identifi的解决方案
- org.springframework.dao.InvalidDataAccessApiUsageException问题解决
- org.springframework.dao.InvalidDataAccessApiUsageException
- javaEE-----org.springframework.dao.InvalidDataAccessApiUsageException: Write operation
- org.springframework.dao.InvalidDataAccessApiUsageException
- hibernate异常:org.springframework.dao.InvalidDataAccessApiUsageException解决办法
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
- org.springframework.dao.InvalidDataAccessApiUsageException: read-only mode (FlushMode.MANUAL)
- org.springframework.dao.InvalidDataAccessApiUsageException
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
- org.springframework.dao.InvalidDataAccessApiUsageException错误
- [spring]:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode
- org.springframework.dao.InvalidDataAccessApiUsageException
- [spring]:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode
- org.springframework.dao.InvalidDataAccessApiUsageException