⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 librarydao.java~12~

📁 图书馆管理系统 第1章 系统简介 图书馆是各大高等院校的重要组成部门
💻 JAVA~12~
字号:
package com.dao;

import com.core.ConnDB;
import java.sql.*;
import com.actionForm.LibraryForm;
/**
 * <p>Title: LibraryManage</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class LibraryDAO {
    ConnDB conn=null;
    public LibraryDAO() {
        conn=new ConnDB();
    }
    public LibraryForm query(){
        LibraryForm libraryForm1=null;
        String sql = "select * from tb_library where id=1";
        ResultSet rs =conn.executeQuery(sql);
        try {
            while (rs.next()) {
                libraryForm1 = new LibraryForm();
                libraryForm1.setId(Integer.valueOf(rs.getString(1)));
                libraryForm1.setLibraryname(rs.getString(2));
                libraryForm1.setCurator(rs.getString(3));
                libraryForm1.setTel(rs.getString(4));
                libraryForm1.setAddress(rs.getString(5));
                libraryForm1.setEmail(rs.getString(6));
                libraryForm1.setUrl(rs.getString(7));
                libraryForm1.setCreateDate(rs.getString(8));
                libraryForm1.setIntroduce(rs.getString(9));
            }
        } catch (Exception ex) {
        }
        conn.close();
        return libraryForm1;
    }
    public int update(LibraryForm libraryForm){
        String sql="UPDATE tb_library SET libraryname='"+libraryForm.getLibraryname()+"',curator='"+libraryForm.getCurator()+"',tel='"+libraryForm.getTel()+"',address='"+libraryForm.getAddress()+"',email='"+libraryForm.getEmail()+"',url='"+libraryForm.getUrl()+"',createDate='"+libraryForm.getCreateDate()+"',introduce='"+libraryForm.getIntroduce()+"' where id=1";
        return flag;
    }


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -