81,092
社区成员
发帖
与我相关
我的任务
分享
首先我要做的就是查出一个集合,添加到另外一个表里,之前是没用到RKRQ,是可以添加的,后来加了一个RKRQ,
就怎么也不能加,一直报错,说好像是找不到属性?
详情:
查出集合的数据,里面是Map,Map里有一个字段是RKRQ 就是入库日期,
之前用批处理出错了,又改成现在这个样子,还是一样的错误
public int batchAddGrQyGlb(List<Map> gxList){
// doBatch(gxList, "Grxy.batchAddGrQyGlb");
for(int i = 0; i < gxList.size(); i++){
Map map = gxList.get(i);
sqlMapClient.insert("Grxy.batchAddGrQyGlb", map);
}
return 1;
}
@SuppressWarnings("unchecked")
public void doBatch(final List<Map> replyList, final String ibatisId){
// 执行回调
sqlMapClient.execute(new SqlMapClientCallback(){
// 实现回调接口
public Object doInSqlMapClient(SqlMapExecutor executor){
// 开始批处理
try{
executor.startBatch();
for(Map map : replyList){
// 插入操作
sqlMapClient.insert(ibatisId, map);
}
executor.executeBatch();
}catch(SQLException e){
e.printStackTrace();
}
return null;
}
});
}
<select id="getGxRecords" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select fr.SFZJMC, fr.SFZJHM, isNull(dj.FDDBR, fr.XM) XM, dj.NBXH, bg.RKRQ YXQX, dj.RKRQ LASTRKSJ
from db_zxxt.ZX_GS_QYDJ dj left join db_zxxt.ZX_GS_FDDBR fr on dj.NBXH = fr.NBXH
left join db_zxxt.ZX_GS_BGNR bg on fr.NBXH = bg.NBXH
where dj.RKRQ >= #lastRksj#
order by dj.RKRQ asc
</select>
<insert id="batchAddGrQyGlb" parameterClass="java.util.HashMap">
insert into db_grxy.QYXG_GRQYGLB (SFZJMC, SFZJHM, XM, XYDJ, NBXH, GRLB, YXQX, LASTRKSJ)
values ( #SFZJMC:VARCHAR#, #SFZJHM:VARCHAR#, #XM:VARCHAR#, #XYDJ:VARCHAR#, #NBXH#, 'fr', #YXQX:DATE#, #LASTRKSJ:DATE# )
</insert>
... 19 more
2012-01-10 20:19:47,102 ERROR [org.quartz.core.ErrorLogger] - Job (DEFAULT.jobDetail1 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'execute' on target class [class gov.nbcredit.grxy.dsrw.GsJobImpl] failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException]
at org.quartz.core.JobRunShell.run(JobRunShell.java:214)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
* Nested Exception (Underlying Cause) ---------------
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'execute' on target class [class gov.nbcredit.grxy.dsrw.GsJobImpl] failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:273)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:203)
at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:364)
at gov.nbcredit.grxy.dao.GrxyDao.batchAddGrQyGlb(GrxyDao.java:28)
at gov.nbcredit.grxy.service.GrxyGsService.batchAddGrQyGlb(GrxyGsService.java:30)
at gov.nbcredit.grxy.dsrw.GsJobImpl.QyfrGxJob(GsJobImpl.java:63)
at gov.nbcredit.grxy.dsrw.base.GsJob.execJob(GsJob.java:14)
at gov.nbcredit.grxy.dsrw.base.DsrwJob.execute(DsrwJob.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:264)
... 3 more
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:94)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:447)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at org.springframework.orm.ibatis.SqlMapClientTemplate$8.doInSqlMapClient(SqlMapClientTemplate.java:366)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:200)
... 15 more
Caused by: java.lang.NullPointerException
at com.ibatis.sqlmap.engine.type.UnknownTypeHandler.setParameter(UnknownTypeHandler.java:69)
at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameter(BasicParameterMap.java:165)
at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameters(BasicParameterMap.java:125)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:79)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate(GeneralStatement.java:200)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:78)
... 19 more
2012-01-10 20:19:47,115 DEBUG [org.quartz.core.JobRunShell] - Calling execute on job DEFAULT.jobDetail1
2012-01-10 20:19:47,049 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'Sybase'
2012-01-10 20:19:47,049 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'Sybase'
2012-01-10 20:19:47,049 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'Sybase' to allow for resolving potential circular references
2012-01-10 20:19:47,050 DEBUG [org.springframework.beans.TypeConverterDelegate] - Converting String to [class [Ljava.lang.String;] using property editor [org.springframework.beans.propertyeditors.StringArrayPropertyEditor@d5cabc]
2012-01-10 20:19:47,050 DEBUG [org.springframework.beans.TypeConverterDelegate] - Converting String to [class [Ljava.lang.String;] using property editor [org.springframework.beans.propertyeditors.StringArrayPropertyEditor@d5cabc]
2012-01-10 20:19:47,050 DEBUG [org.springframework.beans.TypeConverterDelegate] - Converting String to [class [Ljava.lang.String;] using property editor [org.springframework.beans.propertyeditors.StringArrayPropertyEditor@d5cabc]
2012-01-10 20:19:47,050 DEBUG [org.springframework.beans.TypeConverterDelegate] - Converting String to [class [Ljava.lang.String;] using property editor [org.springframework.beans.propertyeditors.StringArrayPropertyEditor@d5cabc]
2012-01-10 20:19:47,050 DEBUG [org.springframework.beans.TypeConverterDelegate] - Converting String to [class [Ljava.lang.String;] using property editor
[org.springframework.beans.propertyeditors.StringArrayPropertyEditor@d5cabc]
2012-01-10 20:19:47,051 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'Sybase'
2012-01-10 20:19:47,051 INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
2012-01-10 20:19:47,051 DEBUG [org.springframework.jdbc.support.SQLErrorCodesFactory] - Looking up default SQLErrorCodes for DataSource [org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy@1f10a67]
2012-01-10 20:19:47,054 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Fetching JDBC Connection from DataSource
2012-01-10 20:19:47,054 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Fetching JDBC Connection from DataSource
2012-01-10 20:19:47,076 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource
2012-01-10 20:19:47,076 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource
2012-01-10 20:19:47,079 DEBUG [org.springframework.jdbc.support.SQLErrorCodesFactory] - Database product name cached for DataSource [org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy@1f10a67]: name is 'Adaptive Server Enterprise'
2012-01-10 20:19:47,080 DEBUG [org.springframework.jdbc.support.SQLErrorCodesFactory] - SQL error codes for 'Adaptive Server Enterprise' found
2012-01-10 20:19:47,080 DEBUG [org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Unable to translate SQLException with Error code '0', will now try the fallback translator
2012-01-10 20:19:47,082 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource
2012-01-10 20:19:47,100 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobDetail1 threw an unhandled Exception:
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'execute' on target class [class gov.nbcredit.grxy.dsrw.GsJobImpl] failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:273)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:203)
at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:364)
at gov.nbcredit.grxy.dao.GrxyDao.batchAddGrQyGlb(GrxyDao.java:28)
at gov.nbcredit.grxy.service.GrxyGsService.batchAddGrQyGlb(GrxyGsService.java:30)
at gov.nbcredit.grxy.dsrw.GsJobImpl.QyfrGxJob(GsJobImpl.java:63)
at gov.nbcredit.grxy.dsrw.base.GsJob.execJob(GsJob.java:14)
at gov.nbcredit.grxy.dsrw.base.DsrwJob.execute(DsrwJob.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:264)
... 3 more
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in gov/nbcredit/grxy/properties/ibatis/grxy.xml.
--- The error occurred while applying a parameter map.
--- Check the Grxy.batchAddGrQyGlb-InlineParameterMap.
--- Check the parameter mapping for the 'LASTRKSJ' property.
--- Cause: java.lang.NullPointerException
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:94)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:447)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at org.springframework.orm.ibatis.SqlMapClientTemplate$8.doInSqlMapClient(SqlMapClientTemplate.java:366)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:200)
... 15 more
Caused by: java.lang.NullPointerException
at com.ibatis.sqlmap.engine.type.UnknownTypeHandler.setParameter(UnknownTypeHandler.java:69)
at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameter(BasicParameterMap.java:165)
at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameters(BasicParameterMap.java:125)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:79)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate(GeneralStatement.java:200)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:78)