Exemplo n.º 1
0
 @Override
 public double getcosttotal() {
   // TODO Auto-generated method stub
   try {
     mysqlimp = new MySqlImp();
     String getsum = "SELECT SUM(支出) FROM 利润表";
     ResultSet rs = mysqlimp.query(getsum);
     rs.next();
     double result = rs.getDouble(1);
     rs.close();
     return result;
   } catch (ClassNotFoundException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return 0;
   } catch (SQLException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return 0;
   }
 }