HCY777 2015-12-10 01:34 采纳率: 0%
浏览 2858
已采纳

使用jdbctemplate插入数据到DB2出现异常 不能完全插入

使用jdbctemplate插入数据到DB2出现异常 不能完全插入 插入1000条 只能成功900多条 插入100条 只能成功90多条

 08:54:30.784 [main] DEBUG o.s.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
08:54:30.784 [main] DEBUG o.s.j.d.DriverManagerDataSource - Creating new JDBC DriverManager Connection to [jdbc:db2://10.188.1.75:50001/gytjdb]
08:54:30.969 [main] DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
08:54:30.969 [main] DEBUG o.s.j.support.SQLErrorCodesFactory - Database product name cached for DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@578ed2]: name is 'DB2/LINUXX8664'
08:54:30.971 [main] DEBUG o.s.j.support.SQLErrorCodesFactory - SQL error codes for 'DB2/LINUXX8664' found
08:54:30.971 [main] DEBUG o.s.j.s.SQLErrorCodeSQLExceptionTranslator - Using nested SQLException from the BatchUpdateException
08:54:30.971 [main] DEBUG o.s.j.s.SQLErrorCodeSQLExceptionTranslator - Unable to translate SQLException with Error code '-302', will now try the fallback translator
08:54:31.001 [main] DEBUG o.s.j.s.SQLStateSQLExceptionTranslator - Extracted SQL state class '22' from value '22001'
08:54:31.004 [main] DEBUG o.s.t.c.s.DirtiesContextTestExecutionListener - After test method: context [DefaultTestContext@1efe574 testClass = ReadFileFromFtp, testInstance = com.pactera.listener.employee.ReadFileFromFtp@c12ad8, testMethod = test@ReadFileFromFtp, testException = org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [ insert into SC_JRN_INFO_B values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; [jcc][t4][102][10040][3.69.24] 批处理出现故障。虽然已经提交了批处理,但是该批处理的某个成员至少发生了一个异常。
使用 getNextException() 来检索已经过批处理的特定元素的异常。 ERRORCODE=-4229, SQLSTATE=null; nested exception is com.ibm.db2.jcc.am.BatchUpdateException: [jcc][t4][102][10040][3.69.24] 批处理出现故障。虽然已经提交了批处理,但是该批处理的某个成员至少发生了一个异常。
使用 getNextException() 来检索已经过批处理的特定元素的异常。 ERRORCODE=-4229, SQLSTATE=null, mergedContextConfiguration = [MergedContextConfiguration@1e3f34c testClass = ReadFileFromFtp, locations = '{classpath:applicationContext-common.xml, classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], class dirties context [false], class mode [null], method dirties context [false].
  • 写回答

1条回答 默认 最新

  • IT丶小农民 2015-12-17 09:31
    关注

    个人建议指定字段插入

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站