LibraryDAO.java~11~
上传用户:toby828
上传日期:2015-06-26
资源大小:8558k
文件大小:2k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. package com.dao;
  2. import com.core.ConnDB;
  3. import java.sql.*;
  4. import com.actionForm.LibraryForm;
  5. /**
  6.  * <p>Title: LibraryManage</p>
  7.  *
  8.  * <p>Description: </p>
  9.  *
  10.  * <p>Copyright: Copyright (c) 2006</p>
  11.  *
  12.  * <p>Company: </p>
  13.  *
  14.  * @author not attributable
  15.  * @version 1.0
  16.  */
  17. public class LibraryDAO {
  18.     ConnDB conn=null;
  19.     public LibraryDAO() {
  20.         conn=new ConnDB();
  21.     }
  22.     public LibraryForm query(){
  23.         LibraryForm libraryForm1=null;
  24.         String sql = "select * from tb_library where id=1";
  25.         ResultSet rs =conn.executeQuery(sql);
  26.         try {
  27.             while (rs.next()) {
  28.                 libraryForm1 = new LibraryForm();
  29.                 libraryForm1.setId(Integer.valueOf(rs.getString(1)));
  30.                 libraryForm1.setLibraryname(rs.getString(2));
  31.                 libraryForm1.setCurator(rs.getString(3));
  32.                 libraryForm1.setTel(rs.getString(4));
  33.                 libraryForm1.setAddress(rs.getString(5));
  34.                 libraryForm1.setEmail(rs.getString(6));
  35.                 libraryForm1.setUrl(rs.getString(7));
  36.                 libraryForm1.setCreateDate(rs.getString(8));
  37.                 libraryForm1.setIntroduce(rs.getString(9));
  38.             }
  39.         } catch (Exception ex) {
  40.         }
  41.         conn.close();
  42.         return libraryForm1;
  43.     }
  44.     public int update(LibraryForm libraryForm){
  45.         String sql="UPDATE tb_library SET libraryname='"++"',curator='"++"',tel='"++"',address='"++"',email='"++"',url='"++"',createDate='"++"',introduce='"++"' where id=1";
  46.         return flag;
  47.     }
  48. }