当前位置:文档之家› 基于java的图书管理系统源代码

基于java的图书管理系统源代码

基于java的图书管理系统源代码声明:本系统是基于C/S的图书管理系统,主要使用的是Oracle数据库,下面附所有实现代码package library;import java.awt.BorderLayout;import java.awt.Container;import java.awt.GridLayout;import java.awt.event.ActionEvent; importjava.awt.event.ActionListener; import java.sql.ResultSet;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane; import javax.swing.JPanel;import javax.swing.JTextField; public class book_add extends JFrame implements ActionListener{DataBaseManager db=new DataBaseManager();ResultSet rs;JPanel panel1,panel2;JLabel book_id_label,book_name_label,author_label,press_label,press_date_label,price_label,book_num_label,borrowed_num _label,address;JTextField book_id_TextField,book_name_TextField,author_TextField, press_TextField,press_date_TextField,price_TextField,book_num_TextFi eld,borrowed_count;JComboBox addresst;Container c;JButton clear,add,exit;public book_add(){super("添加图书信息");c=getContentPane();c.setLayout(new BorderLayout());book_id_label=new JLabel("编号",JLabel.CENTER);book_name_label=new JLabel("名称",JLabel.CENTER);1author_label=new JLabel("作者",JLabel.CENTER);press_label=new JLabel("出版社",JLabel.CENTER);press_date_label=new JLabel("出版日期",JLabel.CENTER);price_label=new JLabel("价格",JLabel.CENTER);book_num_label=new JLabel("库存数",JLabel.CENTER);borrowed_num_label=new JLabel("已借阅数",JLabel.CENTER);address=new JLabel("藏书地址",JLabel.CENTER);book_id_TextField=new JTextField(15);book_name_TextField=new JTextField(15);author_TextField=new JTextField(15); press_TextField=new JTextField(15); press_date_TextField=new JTextField(15); price_TextField=new JTextField(15); book_num_TextField=new JTextField(15); borrowed_count=new JTextField(15); borrowed_count.setText("0");addresst=new JComboBox();addresst.addItem("扬子津图书馆"); addresst.addItem("荷花池图书馆"); addresst.addItem("瘦西湖图书馆"); addresst.addItem("淮海路图书馆");panel1=new JPanel();panel1.setLayout(new GridLayout(9,2)); panel1.add(book_id_label);panel1.add(book_id_TextField);panel1.add(book_name_label);panel1.add(book_name_TextField);panel1.add(press_label);panel1.add(press_TextField);panel1.add(author_label);panel1.add(author_TextField);panel1.add(press_date_label);panel1.add(press_date_TextField);panel1.add(price_label);panel1.add(price_TextField);panel1.add(book_num_label);panel1.add(book_num_TextField);panel1.add(borrowed_num_label);panel1.add(borrowed_count);panel1.add(address);panel1.add(addresst);panel2=new JPanel();panel2.setLayout(new GridLayout(1,3)); clear=new JButton("清空");2clear.addActionListener(this);add=new JButton("添加");add.addActionListener(this);exit=new JButton("退出");exit.addActionListener(this);panel2.add(clear);panel2.add(add);panel2.add(exit);c.add(panel1,BorderLayout.CENTER);c.add(panel2,BorderLayout.SOUTH); setVisible(true);}public void actionPerformed(ActionEvent e){if(e.getSource()==exit){this.dispose();}else if(e.getSource()==clear){book_id_TextField.setText("");book_name_TextField.setText("");author_TextField.setText("");press_TextField.setText("");press_date_TextField.setText("");price_TextField.setText("");book_num_TextField.setText("");}else if(e.getSource()==add){if(book_id_TextField.getText().trim().equals("")){JOptionPane.showMessageDialog(null, "书号不能为空");}else if(book_name_TextField.getText().trim().equals("")) {JOptionPane.showMessageDialog(null, "书名不能为空");}else if(author_TextField.getText().trim().equals("")) {JOptionPane.showMessageDialog(null, "作者不能为空");}else if(press_TextField.getText().trim().equals(""))3{JOptionPane.showMessageDialog(null, "出版社不能为空");}else if(press_date_TextField.getText().trim().equals("")) {JOptionPane.showMessageDialog(null, "出版日期不能为空"); }else if(price_TextField.getText().trim().equals("")){JOptionPane.showMessageDialog(null, "价格不能为空");}else if(book_num_TextField.getText().trim().equals("")) {JOptionPane.showMessageDialog(null, "库存不能为空");}else if(borrowed_count.getText().trim().equals("")){JOptionPane.showMessageDialog(null, "借阅数不能为空");}else {try{String strSQL="insert intobook(book_id,book_name,press,author,press_date,price,book_count,borr owed_count,store_address) values('"+book_id_TextField.getText().trim()+"','"+book_name_TextField.getText().trim()+"','"+press_TextField.getText().trim()+"','"+author_TextField.getText().trim()+"','"+press_date_TextField.getText().trim()+"','"+price_TextField.getText().trim()+"','"+book_num_TextField.getText().trim()+"','"+borrowed_count.getText().trim()+"','"+addresst.getSelectedItem()+"')";if(db.updateSql(strSQL)){4this.dispose();JOptionPane.showMessageDialog(null," 添加图书成功");}else{JOptionPane.showMessageDialog(null," 添加图书失败");this.dispose();}db.closeConnection();}catch(Exception ex){System.out.println(ex.toString()); }}}}}package library;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.ResultSet;import java.sql.SQLException; public class book_delete extends JFrame implements ActionListener{DataBaseManager db=new DataBaseManager();ResultSet rs;Container c;JLabel TipLabel=new JLabel("请选择要删除的书名",JLabel.CENTER);JComboBox bb=new JComboBox();JButton yes,exit;JPanel panel1=new JPanel();public book_delete(){super("删除图书信息");c=getContentPane();c.setLayout(new BorderLayout());5try{String strSQL="select book_name from book wherebook_count>borrowed_count";rs=db.getResult(strSQL);while(rs.next()){bb.addItem(rs.getString(1));}}catch(SQLException sqle){System.out.println(sqle.toString());}catch(Exception ex){System.out.println(ex.toString());}c.add(TipLabel,BorderLayout.NORTH);c.add(bb,BorderLayout.CENTER);yes=new JButton("确定");exit=new JButton("退出");yes.addActionListener(this);exit.addActionListener(this);panel1.add(yes);panel1.add(exit);c.add(panel1,BorderLayout.SOUTH); setVisible(true);}public void actionPerformed(ActionEvent e) {if(e.getSource()==exit){this.dispose();}else if(e.getSource()==yes){try{String strSQL="select borrowed_count from book wherebook_name='"+bb.getSelectedItem()+"'";rs=db.getResult(strSQL);if(!rs.first()){JOptionPane.showMessageDialog(null,"书库里没有你要删除的书");}else{6String strSql="delete from book where book_name='"+bb.getSelectedItem()+"'and borrowed_count=0";rs.first();int count=rs.getInt(1);if(!(count==0)){JOptionPane.showMessageDialog(null,"此书还有学生没有还,不可删除");}else if(db.updateSql(strSql)){JOptionPane.showMessageDialog(null,"删除成功");db.closeConnection();this.dispose();}else{JOptionPane.showMessageDialog(null,"删除失败");db.closeConnection();this.dispose();}}}catch(SQLException sqle){System.out.println(sqle.toString());}catch(Exception ex){System.out.println(ex.toString());}}}}package library;import java.awt.BorderLayout; import java.awt.Container;import java.awt.GridLayout; import java.awt.event.ActionEvent;import java.awt.event.ActionListener; import java.sql.ResultSet;import javax.swing.JButton; import javax.swing.JFrame;7import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JTextField;public class book_modify extends JFrame implements ActionListener{ DataBaseManager db=new DataBaseManager();ResultSet rs;JPanel panel1,panel2,panel3;JLabel TipLabel=new JLabel("输入书名点确定,将调出此书的相关信息");JLabel book_name_label,author_label,press_label,press_date_label,price_label;JTextField book_name_TextField,author_TextField,press_TextField,press_date_TextField,price_TextField;Container c;JButton clear,yes,update,exit;public book_modify(){super("修改图书信息");c=getContentPane();c.setLayout(new BorderLayout());panel3=new JPanel();panel3.add(TipLabel);c.add(panel3,BorderLayout.NORTH);book_name_label=new JLabel("名称",JLabel.CENTER); author_label=new JLabel("作者",JLabel.CENTER);press_label=new JLabel("出版社",JLabel.CENTER);press_date_label=new JLabel("出版日期",JLabel.CENTER); price_label=new JLabel("价格",JLabel.CENTER);book_name_TextField=new JTextField(15);author_TextField=new JTextField(15);press_TextField=new JTextField(15);press_date_TextField=new JTextField(15);price_TextField=new JTextField(15);panel1=new JPanel();panel1.setLayout(new GridLayout(6,2));panel1.add(book_name_label);panel1.add(book_name_TextField);panel1.add(author_label);panel1.add(author_TextField);panel1.add(press_label);panel1.add(press_TextField);panel1.add(press_date_label);panel1.add(press_date_TextField);panel1.add(price_label);8panel1.add(price_TextField);panel2=new JPanel();panel2.setLayout(new GridLayout(1,4)); clear=new JButton("清空");yes=new JButton("确定");update=new JButton("更新");exit=new JButton("退出");panel2.add(clear);panel2.add(yes);panel2.add(update);panel2.add(exit);clear.addActionListener(this);yes.addActionListener(this);update.addActionListener(this);exit.addActionListener(this);update.setEnabled(false);c.add(panel1,BorderLayout.CENTER);c.add(panel2,BorderLayout.SOUTH); setVisible(true);}public void actionPerformed(ActionEvent e) {if(e.getSource()==exit){this.dispose();;}else if(e.getSource()==clear){book_name_TextField.setText("");author_TextField.setText("");press_TextField.setText("");press_date_TextField.setText("");price_TextField.setText("");}else if(e.getSource()==yes){try{String strSQL="select * from book where book_name='"+book_name_TextField.getText().trim()+"'";rs=db.getResult(strSQL);while(rs.next()){book_name_TextField.setText(rs.getString("book_name")); author_TextField.setText(rs.getString("author"));9press_TextField.setText(rs.getString("press"));press_date_TextField.setText(rs.getString("press_date")); price_TextField.setText(rs.getString("price"));}update.setEnabled(true);}catch(NullPointerException upe){System.out.println(upe.toString());}catch(Exception es){System.out.println(es.toString());}}else if(e.getSource()==update){try{String strSQL="update book set book_name='"+book_name_TextField.getText().trim()+"',press='"+press_TextField.getText().trim()+"',author='"+author_TextField.getText().trim()+"',press_date='"+press_date_TextField.getText().trim()+"',price='"+price_TextField.getText().trim()+"' wherebook_name='"+book_name_TextField.getText().trim()+"'";if(db.updateSql(strSQL)){this.dispose();JOptionPane.showMessageDialog(null,"更新图书成功");}else {JOptionPane.showMessageDialog(null,"更新图书失败");}db.closeConnection();}catch(Exception sqle){System.out.println(sqle.toString());}}}}package library;import java.awt.BorderLayout;import java.awt.Container;import java.awt.GridLayout;import java.awt.event.ActionEvent;10import java.awt.event.ActionListener; import java.sql.ResultSet; import java.sql.SQLException;import java.text.DateFormat;import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JTextField;public class bookborrow extends JFrame implements ActionListener{ DataBaseManager db=new DataBaseManager();ResultSet rs;Container c;JPanel panel1,panel2;JLabel borrowname,bookname,borrowdate,returndate,is_return_label; JTextField borrowdateField,returndateField,is_return;JButton clear,yes,cancel;JComboBox borrownameBox=new JComboBox();JComboBox booknameBox=new JComboBox();public bookborrow(){super("书籍出借");c=getContentPane();c.setLayout(new BorderLayout());Calendar cal = Calendar.getInstance();int year,month,day;// year=cal.get(Calendar.YEAR);// month=cal.get(Calendar.MONTH)+3;//从0开始的// day=cal.get(Calendar.DAY_OF_MONTH); // java.text.SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // String cdate =sdf.format(cal.getTime());// Stringda=Integer.toString(year)+"-0"+Integer.toString(month)+"-"+Integer.toString(day);borrowname=new JLabel("借阅者姓名",JLabel.CENTER);bookname=new JLabel("书名",JLabel.CENTER);borrowdate=new JLabel("借书日期",JLabel.CENTER);11// returndate=new JLabel("应还日期",JLabel.CENTER);is_return_label=new JLabel("是否归还",JLabel.CENTER);borrowdateField=new JTextField(15); //borrowdateField.setText(cdate); // returndateField=new JTextField(15); // returndateField.setText(da);is_return=new JTextField(15);is_return.setText("否");try{String strSql="select student_name from reader ";rs=db.getResult(strSql);while(rs.next()){borrownameBox.addItem(rs.getString(1));}}catch(SQLException sqle){System.out.println(sqle.toString());}catch(Exception ex){System.out.println(ex.toString());}try{String strSQL="select book_name from book where book_count>borrowed_count";rs=db.getResult(strSQL);while(rs.next()){booknameBox.addItem(rs.getString(1));}}catch(SQLException sqle){System.out.println(sqle.toString());}catch(Exception ex){System.out.println(ex.toString());}panel1=new JPanel();panel1.setLayout(new GridLayout(5,2));panel1.add(borrowname);panel1.add(borrownameBox);panel1.add(bookname);panel1.add(booknameBox);panel1.add(borrowdate);panel1.add(borrowdateField);// panel1.add(returndate);// panel1.add(returndateField);panel1.add(is_return_label);12panel1.add(is_return);c.add(panel1,BorderLayout.CENTER);panel2=new JPanel();panel2.setLayout(new GridLayout(1,3)); clear=new JButton("清空");yes=new JButton("确定");cancel=new JButton("取消");clear.addActionListener(this);yes.addActionListener(this);cancel.addActionListener(this);panel2.add(clear);panel2.add(yes);panel2.add(cancel);c.add(panel2,BorderLayout.SOUTH); setVisible(true);setSize(300,300);}public void actionPerformed(ActionEvent e){if(e.getSource()==cancel){this.dispose();}else if(e.getSource()==clear){borrowdateField.setText(""); // returndateField.setText(""); is_return.setText("");}else if(e.getSource()==yes){if(borrownameBox.getSelectedItem().equals("")){JOptionPane.showMessageDialog(null, "对不起,没有读者借阅"); }else if(booknameBox.getSelectedItem().equals("")){JOptionPane.showMessageDialog(null, "对不起,现在书库没有书"); }else {try{//系统计算归还日期13//获取输入的借阅日期,自动加两个月String startDate=borrowdateField.getText().trim();SimpleDateFormat format=newSimpleDateFormat("yyyy-MM-dd");Date dateStart=format.parse(startDate);Calendar cd=Calendar.getInstance();cd.setTime(dateStart);cd.add(Calendar.MONTH, 2);String returnDate=format.format(cd.getTime());String strSQL="insert intoborrow(student_name,book_name,borrow_date,return_date,is_returned) values('"+borrownameBox.getSelectedItem()+"','"+booknameBox.getSelectedItem()+"','"+borrowdateField.getText().trim()+"','"+returnDate+"','"+is_return.getText().trim()+"')";if(db.updateSql(strSQL)){JOptionPane.showMessageDialog(null, "借阅完成");strSQL = "update reader setborrow_count=borrow_count+1 wherestudent_name='"+borrownameBox.getSelectedItem() +"'";db.updateSql(strSQL);strSQL="update book setborrowed_count=borrowed_count+1 wherebook_name='"+booknameBox.getSelectedItem()+"'";db.updateSql(strSQL);db.closeConnection();this.dispose();}else{JOptionPane.showMessageDialog(null, "借阅失败");db.closeConnection();this.dispose();}}catch(Exception se){System.out.println(se.toString());}}14}}}package library;import javax.swing.*;import javax.swing.table.DefaultTableModel;import java.awt.*;import java.awt.event.*;import java.sql.ResultSet;import java.sql.SQLException; import java.util.Vector;public class bookborrowlist extends JFrame implements ActionListener{DataBaseManager db=new DataBaseManager();ResultSet rs;Container c;JPanel panel1,panel2;JLabel bookname,studentname;JTextField booknamet,studentnamet;JButton search,exit;JTable table=null;DefaultTableModel defaultModel=null;public bookborrowlist(){super("借阅列表");c=getContentPane();c.setLayout(new BorderLayout());bookname=new JLabel("书名",JLabel.CENTER);studentname=new JLabel("人名",JLabel.CENTER);booknamet=new JTextField(15);studentnamet=new JTextField(15);search=new JButton("查询");exit=new JButton("退出");search.addActionListener(this);exit.addActionListener(this);Box box1=Box.createHorizontalBox();box1.add(studentname);box1.add(studentnamet);box1.add(search);Box box2=Box.createHorizontalBox();15box2.add(bookname);box2.add(booknamet);box2.add(exit);Box boxH=Box.createVerticalBox();boxH.add(box1);boxH.add(box2);boxH.add(Box.createVerticalGlue());panel1=new JPanel();panel1.add(boxH);panel2=new JPanel();String []name={"读者","书名","借阅时间","应还时间","是否归还"};String [][]data=new String[0][0];defaultModel=new DefaultTableModel(data,name);table=new JTable(defaultModel);table.setPreferredScrollableViewportSize(new Dimension(400,80));JScrollPane s=new JScrollPane(table);panel2.add(s);c.add(panel1,BorderLayout.NORTH);c.add(panel2,BorderLayout.SOUTH);}public void actionPerformed(ActionEvent e){if(e.getSource()==exit){db.closeConnection();this.dispose();}else if(e.getSource()==search){String strSQL="selectstudent_name,book_name,borrow_date,return_date,is_returned from borrow";String strSql=null;if(studentnamet.getText().trim().equals("")&&booknamet.getText().tri m().equals("")){strSql=strSQL;}else if(studentnamet.getText().trim().equals("")){strSql="selectstudent_name,book_name,borrow_date,return_date,is_returned from borrow wherebook_name='"+booknamet.getText().trim()+"'";16}else if(booknamet.getText().trim().equals("")){strSql="selectstudent_name,book_name,borrow_date,return_date,is_returned from borrow wherestudent_name='"+studentnamet.getText().trim()+"'";}else{strSql="selectstudent_name,book_name,borrow_date,return_date,is_returned from borrow wherestudent_name='"+studentnamet.getText().trim()+"'and book_name='"+booknamet.getText().trim()+"'";JOptionPane.showMessageDialog(null, "你借的书还还有7天超期");}try{int rowCount=defaultModel.getRowCount()-1;int j=rowCount;for(int i=0;i<=rowCount;i++){defaultModel.removeRow(j);defaultModel.setRowCount(j);j=j-1;}rs=db.getResult(strSql);while(rs.next()){Vector insertRow=new Vector();insertRow.addElement(rs.getString(1));insertRow.addElement(rs.getString(2));insertRow.addElement(rs.getString(3));insertRow.addElement(rs.getString(4));insertRow.addElement(rs.getString(5));defaultModel.addRow(insertRow);}table.revalidate();}catch(SQLException sqle){System.out.println(sqle.toString());}catch(Exception ex){System.out.println(ex.toString());}17}}}package library;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.ResultSet;public class bookborrowModify extends JFrame implements ActionListener{DataBaseManager db=new DataBaseManager();ResultSet rs;JPanel panel1,panel2,panel3;Container c;JLabel tiplabel=new JLabel("输入借阅者姓名和书名单击确定,将调出此书的相关信息");JLabel borrowlabel,namelabel,borrowdate;JTextField borrowField,nameField,dateField;JButton clear,yes,update,cancel;public bookborrowModify(){super("修改图书出借信息");c=getContentPane();c.setLayout(new BorderLayout());panel3=new JPanel();panel3.add(tiplabel);c.add(panel3,BorderLayout.NORTH);borrowlabel=new JLabel("借阅者姓名",JLabel.CENTER);namelabel=new JLabel("书名",JLabel.CENTER);borrowdate=new JLabel("借书日期",JLabel.CENTER);borrowField=new JTextField(15);nameField=new JTextField(15);dateField=new JTextField(15);panel1=new JPanel();panel1.setLayout(new GridLayout(3,2));panel1.add(borrowlabel);panel1.add(borrowField);panel1.add(namelabel);panel1.add(nameField);18panel1.add(borrowdate);panel1.add(dateField);c.add(panel1,BorderLayout.CENTER); panel2=new JPanel();panel2.setLayout(new GridLayout(1,4)); clear=new JButton("清空");yes=new JButton("确定");update=new JButton("更新");cancel=new JButton("取消");clear.addActionListener(this);yes.addActionListener(this);update.addActionListener(this); cancel.addActionListener(this);panel2.add(clear);panel2.add(yes);panel2.add(update);panel2.add(cancel);c.add(panel2,BorderLayout.SOUTH); setVisible(true);setSize(400,200);}public void actionPerformed(ActionEvent e){if(e.getSource()==clear){borrowField.setText("");nameField.setText("");dateField.setText("");}else if(e.getSource()==cancel){this.dispose();}else if(e.getSource()==yes){try{String strSQL="select student_name,book_name,borrow_date from borrow where student_name='"+borrowField.getText().trim()+"'and book_name='"+nameField.getText().trim()+"'";rs=db.getResult(strSQL);if(!rs.first())19{JOptionPane.showMessageDialog(null,"此学生没有借过书或者没有此书");}else{borrowField.setText(rs.getString(1));nameField.setText(rs.getString(2));dateField.setText(rs.getString(3));update.setEnabled(true);}}catch(Exception ex){System.out.println(ex.toString());}}else if(e.getSource()==update){String strSQL="update borrow setborrow_date='"+dateField.getText().trim()+"' where student_name='"+borrowField.getText().trim()+"'and book_name='"+nameField.getText().trim()+"'";if(db.updateSql(strSQL)){JOptionPane.showMessageDialog(null,"更新成功");db.closeConnection();this.dispose();}else{JOptionPane.showMessageDialog(null,"更新失败");db.closeConnection();this.dispose();}}}}package library;import javax.swing.*;import javax.swing.table.DefaultTableModel;import java.awt.*;import java.awt.event.*;import java.sql.ResultSet;import java.sql.SQLException;import java.util.Vector;20public class booklist extends JFrame implements ActionListener{ DataBaseManager db=new DataBaseManager();ResultSet rs;Container c;JPanel panel1,panel2,panel3;JLabel bookname,authorname,press;JTextField booknamet,authornamet,presst;JButton search,exit;JTable table=null;DefaultTableModel defaultModel=null;public booklist(){super("书籍信息查询");c=getContentPane();c.setLayout(new BorderLayout());bookname=new JLabel("书名",JLabel.CENTER); authorname=new JLabel("作者",JLabel.CENTER); press=new JLabel("出版社",JLabel.CENTER); booknamet=new JTextField(15);authornamet=new JTextField(15);presst=new JTextField(15);search=new JButton("查询");exit=new JButton("退出");search.addActionListener(this);exit.addActionListener(this);panel1=new JPanel();panel1.add(bookname);panel1.add(booknamet);panel1.add(authorname);panel1.add(authornamet);panel2=new JPanel();panel2.add(press);panel2.add(presst);panel2.add(search);panel2.add(exit);String []name={"书号","书名","出版社","作者","出版日期","价格","图书数目","已借数目","剩余数目","藏书地址"};String [][]data=new String[0][0];defaultModel=new DefaultTableModel(data,name);table=new JTable(defaultModel);table.setPreferredScrollableViewportSize(new Dimension(400,80));JScrollPane s=new JScrollPane(table);panel3=new JPanel();panel3.add(s);21c.add(panel1,BorderLayout.NORTH);c.add(panel2,BorderLayout.CENTER);c.add(panel3,BorderLayout.SOUTH);}public void actionPerformed(ActionEvent e){if(e.getSource()==exit){db.closeConnection();this.dispose();}else if(e.getSource()==search){String strSQL="selectbook_id,book_name,press,author,press_date,price,book_count,borrowed_ count,book_count-borrowed_count,store_address from book";String strSql=null;if(booknamet.getText().trim().equals("")&&authornamet.getText().trim ().equals("")&&presst.getText().trim().equals("")){strSql=strSQL;}elseif(booknamet.getText().trim().equals("")&&authornamet.getText().trim ().equals("")){strSql="selectbook_id,book_name,press,author,press_date,price,book_count,borrowed_ count,book_count-borrowed_count,store_address from book where press='"+presst.getText().trim()+"'";}elseif(authornamet.getText().trim().equals("")&&presst.getText().trim(). equals("")){。

相关主题