//通过文书表号和案件ID获得某个表的ID

 
 public int getCnIdByCaseId(int caseId,int writId){
  int id=0;
  try{
   super.openConn();
   String sql = " select cn_id from correctnotice where caseID =" + caseId + " and  writID =" + writId;
   pStatement = connection.prepareStatement(sql);
   set = pStatement.executeQuery();
   if(set.next()){
    id = set.getInt(1);
   }
  }catch (Exception e) {
   // TODO: handle exception
   e.printStackTrace();
  }finally{
   super.closeAll();
  }
  return id;
 }

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