首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

jdbctemp 事宜

2012-09-08 
jdbctemp 事务if(list!null && list.size()1){for(int i0i list.size()i++){MaprecordMap(Map)list

jdbctemp 事务

if(list!=null && list.size()>1){
for(int i=0;i< list.size();i++){
Map  recordMap=(Map)list.get(i);
System.out.println(" ================= Record ===== " + recordMap);
int pkKey= Integer.parseInt(recordMap.get("id").toString());

//update   chirldren order with parent id
List childrenList=jdbcTemp.queryForList(childrenSql,new Object[]{iBookId,pkKey});

if(childrenList!=null){
for(int j=0;j< childrenList.size();j++){
Map  childrenRecordMap=(Map)list.get(j);

System.out.println("=================children  Record ===== " + childrenRecordMap);
int childrenPKKey= Integer.parseInt(childrenRecordMap.get("id").toString());
jdbcTemp.update(updateOrderSql,new Object[]{j+2,childrenPKKey});
}
}
//update parent order id.
jdbcTemp.update(updateOrderSql,new Object[]{i+2,pkKey});

}
out.println(" book_id==== ["+sBookId+"]  had not entry! "); 

}
   }catch(org.springframework.dao.DataAccessException ex){

热点排行