@Override
protected void executeInternal(JobExecutionContext arg0)
throws JobExecutionException {
System.out.println("定时任务执行中…");
String sql = "select ID AS id , JUDGEDATE AS judgedate from
PE_JPC_ITEM_INFO where judgeDate IS NOT null " ;
dbpool db = null ;
MyResultSet rs = null ;
int count = 0 ;
try{
db = new dbpool() ;
rs = db.executeQuery(sql) ;
String sf = null ;
List<String> list = new ArrayList<String>() ;
int i = 0 ;
while(rs != null && rs.next()){
i++ ;
Integer judgedate = Integer.parseInt(rs.getString("judgedate")) ;
String id = rs.getString("id") ;
if(judgedate == 0){
sf = " update PE_JPC_ITEM_INFO set JUDGEDATE =
'"+judgedate+"' WHERE ID = '"+id+"' " ;
}else{
sf = " update PE_JPC_ITEM_INFO set JUDGEDATE = '"+(judgedate
- 1)+"' WHERE ID = '"+id+"' ";
}
list.add(sf.toString()) ;
System.out.println("正在组" + i + "条数据");
}
count = db.executeUpdateBatch(list) ;
System.out.println("count:" + count);
}catch(Exception e){
System.out.println("更新失败!");