开发者社区> 问答> 正文

JDBC保存数据报错?报错

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [insert into ufa6p5s91259804431031 (id,requestid,dsporder,nodeid ,field012,field019,field022,field023,field017,field002,field003,field004,field005) values('4028e49454b7bc3f0154bda2851412e3','4028e49454b7bc3f0154bda2850212de',0,'4028826c254d76a501254dde199a000d',5615.00,'2016-05-17','6*********8','常','4028819c0f563f24010f56b04330013c','4028826c2cc8e5d6012cce6c4818654b','8a8a8a972d42739a012d51a652be2916','上海浦东发展银行广州分行锦城花园支行','浦发银行')]; nested exception is java.sql.BatchUpdateException: 列名 'NaN' 无效。
[15:33:45.374]  at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:220)
[15:33:45.374]  at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
[15:33:45.374]  at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:407)
[15:33:45.374]  at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:559)
[15:33:45.374]  at com.velcro.base.BaseJdbcDao.batchUpdate(BaseJdbcDao.java:54)
[15:33:45.374]  at com.velcro.workflow.form.engine.FormService.saveWorkflowform(FormService.java:239)
[15:33:45.374]  at com.velcro.workflow.workflow.servlet.WfBaseAction.saveFormData(WfBaseAction.java:258)
[15:33:45.374]  at com.velcro.workflow.workflow.servlet.WfManageAction.checkCurrentNodeExport(WfManageAction.java:348)
[15:33:45.374]  at com.velcro.workflow.workflow.servlet.WfManageAction.checkExportAndNodeOperator(WfManageAction.java:307)
[15:33:45.374]  at com.velcro.workflow.workflow.servlet.WfManageAction.processTransition(WfManageAction.java:199)
[15:33:45.374]  at com.velcro.workflow.workflow.servlet.WfManageAction.execute(WfManageAction.java:143)
[15:33:45.374]  at com.velcro.base.ServiceAction.doGet(ServiceAction.java:76)
[15:33:45.374]  at com.velcro.base.ServiceAction.doPost(ServiceAction.java:84)
[15:33:45.374]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:159)
[15:33:45.374]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:97)
[15:33:45.374]  at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:109)
[15:33:45.374]  at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
[15:33:45.374]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
[15:33:45.375]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
[15:33:45.375]  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
[15:33:45.375]  at com.velcro.base.security.servlet.VelcroCharacterEncodingFilter.doFilterInternal(VelcroCharacterEncodingFilter.java:101)
[15:33:45.375]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
[15:33:45.375]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
[15:33:45.375]  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
[15:33:45.375]  at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
[15:33:45.375]  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
[15:33:45.375]  at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
[15:33:45.375]  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
[15:33:45.375]  at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:135)
[15:33:45.375]  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
[15:33:45.375]  at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
[15:33:45.375]  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
[15:33:45.375]  at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
[15:33:45.375]  at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
[15:33:45.375]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
[15:33:45.375]  at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156)
[15:33:45.376]  at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:95)
[15:33:45.376]  at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:289)
[15:33:45.376]  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:838)
[15:33:45.376]  at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1349)
[15:33:45.376]  at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1305)
[15:33:45.376]  at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1289)
[15:33:45.376]  at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1197)
[15:33:45.376]  at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:993)
[15:33:45.376]  at com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:117)
[15:33:45.376]  at com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
[15:33:45.376]  at com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
[15:33:45.376]  at com.caucho.network.listen.TcpSocketAcceptThread.run(TcpSocketAcceptThread.java:61)
[15:33:45.376]  at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
[15:33:45.376]  at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)
[15:33:45.377] Caused by: java.sql.BatchUpdateException: 列名 'NaN' 无效。
[15:33:45.377]  at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeBatch(SQLServerStatement.java:1693)
[15:33:45.377]  at com.caucho.sql.UserStatement.executeBatch(UserStatement.java:447)
[15:33:45.377]  at org.springframework.jdbc.core.JdbcTemplate$1BatchUpdateStatementCallback.doInStatement(JdbcTemplate.java:540)
[15:33:45.377]  at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396)
[15:33:45.377]  ... 47 more

展开
收起
爱吃鱼的程序员 2020-06-09 14:31:47 541 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    个人一些见解,首先你用的是jdbctemple的批量更新插入,你贴出来的只有一条sql语句,但是整个过程中你这个方法执行的只有这一条sql吗?如果是为什么用批量更新方法?如果不是请在日志里查看完整的执行的所有sql(应该会找到错误的sql的)。NAN<spanstyle="color:#333333;font-family:arial;font-size:13px;line-height:20.02px;background-color:#FFFFFF;">是NotaNumber看看是不是你拼接sql的时候某个字段非法了。

    2020-06-09 14:32:04
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载