日期:2014-05-20 浏览次数:20631 次
class ISBNFocusListener extends FocusAdapter { public void focusLost(FocusEvent e) { if(!Dao.selectBookInfo(ISBN.getText().trim()).isEmpty()); { JOptionPane.showMessageDialog(null,"添加书号重复"); return; } } } 错误 错误 错误 public static int Insertbook(String ISBN,String typeid,String bookname,String writer,String translator,String publisher,Date date,Double price) { int i=0; try { String sql="insert into bookinfo(ISBN,typeid,bookname,writer,translator,"+ "publisher,date,price)values('"+ISBN+"','"+typeid+"','"+bookname+"','"+writer+"'," + "'"+translator+"'," + "'"+publisher+"','"+date+"','"+price+"')"; i=Dao.executeUpdate(sql); //执行插入操作 } catch(Exception e) { System.out.println(e.getMessage()); } Dao.close(); //关闭连接对象 return i; //返回更新记录数 } 错误 错误 错误