获取最新的CaseID

 //获取最新的CaseID
 public int getNewCaseID(){
  int id=0;
  try {
   super.openConn();
   String sqlString="select max(caseid) from cases";
   pStatement=connection.prepareStatement(sqlString);
   set=pStatement.executeQuery();
   if(set.next()){
    id=set.getInt(1);
   }
  } catch (Exception e) {
   // TODO: handle exception
   e.printStackTrace();
  }
  
  return id;
 }

posted @ 2010-12-10 22:00  小粒  阅读(672)  评论(0)    收藏  举报