Page 877 - 3-2
P. 877

ex.printStackTrace();
                            }finally{
                                    try{
                                            if(stmt!=null)
                                                    stmt.close();
                                    }catch(SQLException se2){
                                    }
                                    try{
                                            if(conn!=null)
                                                    conn.close();
                                    }catch(SQLException se){
                                            se.printStackTrace();
                                    }
                            }
              }


              public static void temp() {
                      Connection conn = null;
                            Statement stmt = null;
                            try{
                                    Class.forName(JDBC_DRIVER);
                                    conn = DriverManager.getConnection
                                                                    (DB_URL,USERNAME,PASSWORD);
                                    stmt = conn.createStatement();
                                    //System.out.println("temp");
                                    String sql;
                                    sql = "update project set temp = "+temp+"
                                                                    where detector = "+tempnum+";";
                                    int rs = stmt.executeUpdate(sql);
                                    //rs.close();
                                    stmt.close();
                                    conn.close();
                            }catch(SQLException se1){
                                    se1.printStackTrace();
                            }catch(Exception ex){
                                    ex.printStackTrace();
                            }finally{
                                    try{
                                            if(stmt!=null)
                                                    stmt.close();
                                    }catch(SQLException se2){
                                    }
                                    try{
                                            if(conn!=null)
                                                    conn.close();


                                                         - 877 -
   872   873   874   875   876   877   878   879   880   881   882