Page 871 - 3-2
P. 871
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jframe.setBounds(100, 100, 574, 226);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
jframe.setContentPane(contentPane);
//System.out.println("11");
Connection conn = null;
Statement stmt = null;
try{
Class.forName(JDBC_DRIVER);
conn =
DriverManager.getConnection(DB_URL,USERNAME,PASSWORD);
stmt = conn.createStatement();
String sql;
sql = "drop table project;";
int rs = stmt.executeUpdate(sql);
//rs.close();
stmt.close();
conn.close();
}catch(SQLException se1){
}catch(Exception ex){
ex.printStackTrace();
}finally{
try{
if(stmt!=null)
stmt.close();
}catch(SQLException se2){
}
try{
if(conn!=null)
conn.close();
}catch(SQLException se){
se.printStackTrace();
}
}
//System.out.println("22");
button1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
sendAll("reset");
f=1;
number=1;
//num=0;
- 871 -