需要取出oracle库中long raw类型的数据并保存为文件(用spring+ibatis),
oracle库中字段为long raw类型,我用byte[]映射该字段,报错'流已被关闭',用java.sql.Blob,报错'类型不匹配',
现在配置:
sqlMap.xml中:
<resultMap id="fileResult" class="UpLoadFile">
<result property="material_id" column="MAT_ID" />
<result property="material_content" column="MATERIAL_CONTENT"
typeHandler="org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler"/>
<result property="fileName" column="MATERIAL_NAME" />
<result property="apply_num" column="APPLY_NUM" />
</resultMap>
spring(applicationContext.xml)中:
<bean id="lobHandler"
class="org.springframework.jdbc.support.lob.DefaultLobHandler"/>
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="dataSource" ref="dataSource2"></property>
<property name="configLocation">
<value>
classpath:com/fangdi/caseflow/persistence/sqlMapConfig2.xml
</value>
</property>
<property name="lobHandler" ref="lobHandler"/>
</bean>
请问我应该用什么类型来匹配该字段如何配置具体的sqlMapConfig2.xml和spring(applicationContext.xml)和其它文件?
分享到:
相关推荐
ibatis 读取oracle clob类型
Ibatis调用Oracle存储过程,返回自定义的类型。
ibatis+oracle简单实例,其中包括ibatis jar包以及oracle驱动包
ibatis学习总结,oracle 学习总结,大数据量处理
一个Ibatis。net 的应用事例 数据库为oracle 用vs2008 导入即可使用。
ibatis调用oracle存储过程分页
ibatis调用oracle存储过程
ibatis oracle ibatis-2.3.3.jar ojdbc14.jar ibatis连接oracle所需的jar包
maven spring struts ibatis oracle框架整合,
spring+ibatis+oracle分页缓存源码
包含了ibatis及jdbc的驱动,需要的可以下载
使用ibatis+oracle完成简单的增删改查的例子,把源码导入myeclipse,修改链接数据库信息,数据库需要自己建立
Spring MVC+ibatis+Oracle资源整合,实现简单的增删改查
iBatis 简介: iBatis 是apache 的一个开源项目,一个O/R Mapping 解决方案,iBatis 最大的特点就是小巧,上手很快。如果不需要太多复杂的功能,iBatis 是能够满足你的要求又足够灵活的最简单的解决方案,这是一个...
添加了log4j 博文链接:https://xiao9.iteye.com/blog/952231
oracle ibatis 配置
本资源适合刚刚接触ibatis+oracle的小伙伴使用,欢迎交流,吐槽。
http://blog.csdn.net/alanchen520/article/details/34057279
ORACLE、IBATIS_20100914 ORACLE、IBATIS_20100914 ORACLE、IBATIS_20100914
spring struts2 ibatis整合,sha1加密,oracle数据库。myeclipse直接导入即可。