예제 #1
0
 public GenSubCOReview(Database db) throws SQLException {
   String query1 =
       "select job.job_name, company.company_name, division, jcd.cost_code, jcd.phase_code,"
           + " contracts.amount from contracts, company, job, job_cost_detail as jcd where job.job_id= "
           + "contracts.job_id and contracts.company_id = company.company_id and "
           + "jcd.cost_code_id = contracts.cost_code_id and contracts.contract_id = "
           + db.contract_id;
   contract = db.dbQuery(query1);
   query1 =
       "select change_orders.change_order_num, change_orders.description, change_order_detail.change_order_id, "
           + "change_order_detail.sub_co_number, change_order_detail.item_number, change_order_detail.subject, change_orders.job_id, job.job_num, "
           + "job.job_name, change_order_detail.status, change_order_detail.unit_amount, change_order_detail.unit_quantity, "
           + "change_order_detail.bonds_and_insurance, change_order_detail.epco_markup, change_order_detail.item_tax from change_orders, "
           + "change_order_detail, job where change_orders.change_order_id = change_order_detail.change_order_id and change_order_detail.contract_id = "
           + db.contract_id
           + " and job.job_id = change_orders.job_id order by sub_co_number";
   item = db.dbQuery(query1);
 }
 public void sessionDestroyed(HttpSessionEvent hse) {
   Database db = null;
   Statement stmt = null;
   try {
     db = new Database();
     db.connect();
     stmt = db.getStatement();
     stmt.executeUpdate(
         "update ext_sessions set closed = 1 where id = '" + hse.getSession().getId() + "'");
   } catch (SQLException e) {
     e.printStackTrace();
   } finally {
     try {
       if (stmt != null) stmt.close();
     } catch (SQLException e) {
     }
     stmt = null;
     if (db != null) db.disconnect();
   }
 }