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
    关注

    个人建议指定字段插入

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

报告相同问题?

悬赏问题

  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题
  • ¥50 Oracle Kubernetes服务器集群主节点无法访问,工作节点可以访问
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架
  • ¥15 有关sql server business intellige安装,包括SSDT、SSMS。
  • ¥15 stm32的can接口不能收发数据
  • ¥15 目标检测算法移植到arm开发板
  • ¥15 利用JD51设计温度报警系统