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

📄 unserve.java~4~

📁 基于Java的物流管理系统的开发与应用
💻 JAVA~4~
字号:
package untitled5;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;import java.io.*;import java.net.*;import java.sql.*;import java.lang.*;import javax.sql.*;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;import javax.swing.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class unserve extends JFrame {  JPanel contentPane;  JLabel jLabel1 = new JLabel();  XYLayout xYLayout1 = new XYLayout();  //Construct the frame  public unserve() {    enableEvents(AWTEvent.WINDOW_EVENT_MASK);    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  //Component initialization  private void jbInit() throws Exception  {    contentPane = (JPanel) this.getContentPane();    jLabel1.setFont(new java.awt.Font("SansSerif", 0, 25));    jLabel1.setForeground(Color.red);    jLabel1.setText("库存管理系统");    contentPane.setLayout(xYLayout1);    this.setSize(new Dimension(500, 400));    this.setTitle("Frame Title");    contentPane.setFont(new java.awt.Font("SansSerif", 0, 20));    contentPane.add(jLabel1,  new XYConstraints(177, 1, 152, 34));  }  //Overridden so we can exit when window is closed  protected void processWindowEvent(WindowEvent e) {    super.processWindowEvent(e);    if (e.getID() == WindowEvent.WINDOW_CLOSING) {      System.exit(0);    }  }  void issn_actionPerformed(ActionEvent e) {    validID();  }  void validID() {     System.out.println("JLKJLJLJLJL");    try {      String str1;      str1 = issn.getText();      int number=Integer.parseInt(str1);     // int issn=Integer.parseInt(str1);      System.out.println(str1);     // str2 = jPasswordField1.getText();     // System.out.println(str1);      //System.out.println(str2);      //装载jdbc驱动程序      String driverName = "oracle.jdbc.OracleDriver";      Driver driver = (Driver) Class.forName(driverName).newInstance();      //连接数据库      Connection con = DriverManager.getConnection(          "jdbc:oracle:thin:@thsspc0791:1521:tongfang", "sa", "tongfang");      PreparedStatement pstmt = con.prepareStatement(          " update  book  set   yuding='no'   where    issn=? ");      pstmt.setString(1, str1);      ResultSet res = pstmt.executeQuery();      System.out.println("ljljljljljljlj");      //String sa=res.getString(1);      //if ((!res.next()) || res.getString("issn")== null) {        //JOptionPane.showMessageDialog(this, "查无此书", "错误",                                    //JOptionPane.ERROR_MESSAGE);     // }else {         { String outputarea="祝贺您!!!"+"\n"+"\n"+"您已经成功取消预定此书";          //System.out.println("aksdjflkajsdlf");         // do{          //System.out.println(res.getString(1)+":" + res.getLong(2) + ":" +res.getLong(3) +":"+res.getInt(4)+":"+res.getString(5)+":"+res.getString(6)+":"+res.getInt(7));          //outputarea+="  "+res.getString(1)+"  "+"  "+res.getString(2)+"  "+"  "+res.getLong(3)+"  "+"      "+res.getString(4)+"  "+"     "+res.getString(5)+"  "+"   "+res.getDate(6)+"      "+"    "+res.getInt(7)+"  "+"   "+res.getString(8)+"   "+"\n";           showmessage.setText(outputarea);          //}while (res.next());      }      pstmt.close();      con.close();    }catch (InstantiationException e) {      System.out.println(e.getMessage());    }catch (IllegalAccessException e) {      System.out.println(e.getMessage());    }catch (ClassNotFoundException e) {      System.out.println(e.getMessage());    }catch (SQLException edd) {      edd.printStackTrace() ;      System.out.println(edd.getMessage());    }  }}

⌨️ 快捷键说明

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