毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

软件图书管理系统+CDM图+PDM图+表间关系图 第8页

更新时间:2008-7-8:  来源:毕业论文

软件图书管理系统,关联图+DFD图+实体属性图+ER图

//查找一条记录统一函数

   private Hashtable searchOneData(String sql)

   {

          Hashtable hash = new Hashtable();

          ResultSet rs = selectRecord(sql);

 

          Statement stmt = null;

          try{

                 //取得列数和列名

                 ResultSetMetaData rsmd = rs.getMetaData();

                 int cols = rsmd.getColumnCount();

                 if(rs.next())

                 {    

                        for(int i=1;i<=cols;i++)

                        {

                               String field = ds.toString(rsmd.getColumnName(i));

                               String value = ds.toString(rs.getString(i));

                               hash.put(field,value);

                        }

                 }

          }catch(Exception e){System.out.println("运行时出错:"+e);}

          finally{

                 if(rs!=null)try{ stmt = rs.getStatement(); rs.close();}catch(Exception e){System.out.println("关闭记录集rs时出错"+e);}

                 if(stmt!=null) try{stmt.close();}catch(Exception e){System.out.println("关闭声明时statement出错"+e);}          

          }

          return hash;

   }    

}//设置借阅ID

   public void setID(String i)

   {

          id = i;

   }

 

   //取得所有信息内容

   public Vector getData()

   {

          String sql = "";

          sql = "select * from KJB2_KJXX_JYB where ZT='"+strZero+"' order by JYID";

          return searchData(sql);

   }

  

   //分页取得所有信息

   public Vector getPageData(int page)

   {

          String sql ="";

          sql="select * from KJB2_KJXX_JYB where ZT='"+strZero+"' order by JYID";

          return  getOnePage(sql,page,20);

   }

 

   //根据借阅号取得此详细信息

   public Hashtable getOneData(String id)

   {

          String sql="";

          sql = "select * from KJB2_KJXX_JYB where JYID="+id+"";

          return searchOneData(sql);

   }

 

   //删除库信息

   public int delJYXX(String id)

   {

          String sql="";

          sql="delete from KJB2_KJXX_JYB where JYID="+id;

          return deleteRecord(sql);

   }

 

   //新增借阅记录,参数

   public int[] addBorrow(Hashtable hash)

   {

          System.out.println("批量处理新增借阅。。。。。。");

          String sql="";

          int intID = makeID("KJB2_KJXX_JYB","JYID","","",true);

          String strID=String.valueOf(intID);

          String strZJH = ds.toString((String)hash.get("ZJH"));//证件号

          String strSQH = ds.toString((String)hash.get("SQH"));//索取号

          String strJYSJ = ds.toString((String)hash.get("JYSJ"));//借阅时间

 

          String strREADERID = "";

          String strBOOKID = "";

          String strDQSJ = "";

          String strXJCS = "";

         

          //根据读者证件号取的读者ID//根据读者ID取得规则ID,然后取得可以借阅天数,

          sql=" select KJB2_KJXX_READER.RULEID,KJB2_KJXX_READER.READERID,KJB2_KJXX_RULE.KJYSJ "

             +" from KJB2_KJXX_READER,KJB2_KJXX_RULE "

             +" where KJB2_KJXX_READER.ZJH='"+strZJH+"' and KJB2_KJXX_READER.RULEID=KJB2_KJXX_RULE.RULEID ";

          Hashtable hashReId=(Hashtable)searchOneData(sql);

          strREADERID=ds.toString((String)hashReId.get("READERID"));

          String strKJYSJ=ds.toString((String)hashReId.get("KJYSJ"));

 

          //根据索取号取得书本ID

       sql="select BOOKID from KJB2_KJXX_STORE where SQH='"+strSQH+"'";

          Hashtable hashBKID=(Hashtable)searchOneData(sql);

          strBOOKID = ds.toString((String)hashBKID.get("BOOKID"));

 

          //新增操作

          createStatement();

          clearBatch();

          sql=" insert into KJB2_KJXX_JYB(JYID,READERID,BOOKID,JYSJ,DQSJ,ZT,XJCS) "

                 +" values("+strID+","+strREADERID+","+strBOOKID+",'"+strJYSJ

                 +"',to_char((to_date('"+strJYSJ+"','yyyy-MM-dd')+"+strKJYSJ+"),'yyyy-MM-dd')"

                 +",'"+strZero+"','"+strZero+"')";

         

          addBatch(sql);

          sql="update KJB2_KJXX_STORE set ZT='借出' where BOOKID="+strBOOKID;

          addBatch(sql);

          sql="update KJB2_KJXX_READER set LJJS=LJJS+1 where READERID="+strREADERID;

          addBatch(sql);

          int result[]=executeBatch();    

          closeStm();

          return result;

   }

 

   //取消借阅11

   public int[] delBorrow(String id)

   {

          System.out.println("批量处理取消借阅。。。。。");

          String sql="";

          sql="select BOOKID from KJB2_KJXX_JYB where JYID="+id;

          Hashtable hash=(Hashtable)searchOneData(sql);

          String strBOOKID=(String)hash.get("BOOKID");

 

          createStatement();

          clearBatch();

          sql="update KJB2_KJXX_JYB set ZT='"+strOne+"' where JYID="+id;

          addBatch(sql);   

          sql="update KJB2_KJXX_STORE set ZT='可借' where BOOKID="+strBOOKID;

          addBatch(sql);   

          int result[]=executeBatch();    

          closeStm();

 

          return result;

   }

  

   //判断证件号的合法性

   public boolean isValidate(String zjh)

   {

          String sql="";

          sql="select * from KJB2_KJXX_READER where ZJH='"+zjh+"' and ZT='注册'";

          Hashtable hash=(Hashtable)searchOneData(sql);

          if(hash.isEmpty())

                 return false;

          else

                 return true;

   }

  

   //判断某书是否可以被借

   public boolean ifCanBorrow(String sqh)

   {

          String sql="";

          sql="select * from KJB2_KJXX_STORE where ZT='可借'";

          Vector vect=(Vector)searchData(sql);

          if(vect.isEmpty())

                 return false;

          else

                 return true;

   }

 

图书借阅的界面JSP代码:

DealStringmain中的一个类,jsp 代码中调用了这个类。

<%

   DealString ds = new DealString();

   //取得菜单类别

   String strType = ds.toString(request.getParameter("txt_type"));

   String strType1 = ds.toString(request.getParameter("txt_type1"));

   String strEdit = ds.toString(request.getParameter("txt_edit"));

   String strID = ds.toString(request.getParameter("txt_id"));

 

 

   String zgbh = ds.toString((String)session.getAttribute("zgbh"));

 

 

 

          <td align="center"><strong>书名</strong></td>

          <td align="center"><strong>索取号</strong></td>

          <td align="center"><strong>借阅日期</strong></td>

          <td align="center"><strong>到期日期</strong></td>

          <td align="center"><strong>续借次数</strong></td>

          <td align="center"><strong>状态</strong></td>

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

软件图书管理系统+CDM图+PDM图+表间关系图 第8页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。