问题描述
StringtheSql="insertintobig_data(pan,acc_date,txn_date,type_mid,rrn,org_id,mid,tid,mch_name,trans_type,money,fee,rec_money,card_type,agent_type,on_line,card_bin)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";pstm=conn.prepareStatement(theSql);obj=newObject[]{dataList.get(0),"to_date('"+dataList.get(1)+"','yyyy-mm-dd')","to_date('"+dataList.get(2)+","+DateConstant.cheDate(dataList.get(3))+"','yyyy-MM-dd,HH24:mi:ss')",dataList.get(4),dataList.get(5),dataList.get(6),dataList.get(7),dataList.get(8),dataList.get(9),dataList.get(10),dataList.get(11),dataList.get(12),dataList.get(13),dataList.get(16),agentType,1,StringUtil.subCardSix(dataList.get(0))};for(inti=0;i<obj.length;i++){pstm.setObject(i+1,obj[i]);}pstm.addBatch();pstm.executeBatch();以下为报错信息:java.sql.BatchUpdateException:ORA-01858:在要求输入数字处找到非数字字符atoracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:441)atoracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3364)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atorg.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)atorg.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)atoracle.jdbc.OracleStatement$$EnhancerByProxool$$25ce4da2.executeBatch(<generated>)atcom.sssoft.data.struts.action.FileUploadAction.upExT1(FileUploadAction.java:806)atcom.sssoft.data.struts.action.FileUploadAction.upExcel(FileUploadAction.java:93)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atorg.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)atorg.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)atorg.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)atorg.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:710)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.sssoft.framework.web.util.CharacterEncodingFilter.doFilter(UnknownSource)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(Thread.java:619)
解决方案
本帖最后由 zhidage 于 2014-07-23 18:30:57 编辑
解决方案二:
打个断点看一下就行了,你在数值类型的地方放入了非数值字符
解决方案三:
断了啊没见哪有错额
解决方案四:
崩溃手拼sql直接放到数据库里边都好使