NutzCN Logo
问答 使用SerialClob插入oracle超出4000报错
发布于 1825天前 作者 qqfe28902f 2044 次浏览 复制 上一个帖子 下一个帖子
标签:

For example:> "INSERT INTO PICTURE_INFO(RECORD_NO,XML_INFO,PARTITION_DATE,REP_FLAG,GUID_REP_ID) VALUES('20180720218479','*Clob(-124089469)','2018-12-27 15:52:02','1','*Blob(hascode=-1038463715)') "
2019-03-06 15:17:52,275 org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:97) DEBUG - SQLException
java.sql.SQLException: ORA-01461: 仅能绑定要插入 LONG 列的 LONG 值

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3685)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1376)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2931)
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2929)
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:131)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runPreparedStatement(NutDaoExecutor.java:308)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:90)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81)
at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:248)
at org.nutz.dao.impl.EntityOperator.exec(EntityOperator.java:50)
at org.nutz.dao.impl.NutDao.fastInsert(NutDao.java:189)
at org.nutz.dao.impl.NutDao.insert(NutDao.java:136)
12 回复

驱动换最新版

数据库驱动

@wendal

com.oracle
ojdbc6
11.2.0.3

还是一样。。。

表字段里面也是Blob和Clob吗? 确定一下是Blob报错还是Clob报错

是Oracle的XMLTYPE类型,使用无pojo的NutMap方式进行插入更新(由于业务不能创建pojo)

XMLTYPE? 看来不是用Clob吧了, 自定义一个ValueAdatper吧, 然后ColDefine引用一下

@ColDefine(adaptor=MyXXXX.class)
private String xxx;

@wendal 那个是通过实体操作,自定义sql有办法没

有, 自定义Sql也可以setAdatpor哦

@wendal 麻烦给个示例,我看文档没得

Sql sql = Sqls.create(".... .... ... @xxx")
sql.setValueAdaptor("xxx", new ValueAdaptor() {
        // 实现一下, jdbc相关知识
})
dao.execute(sql);
添加回复
请先登陆
回到顶部