1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| @FXML
private static ProgressBar progressGeneralist;
//public static ResultSet getMale()
public static ResultSet getNBRmale(){
ResultSet resultSet = null;
try {
String sql = "SELECT COUNT(*) FROM `patient` WHERE GENDER='male'";
Connection con = DBPatient.getConnection();
PreparedStatement preparedStatement = (PreparedStatement) con.prepareStatement(sql);
resultSet = preparedStatement.executeQuery();
progressGeneralist.setProgress(resultSet);
con.close();
}
catch (SQLException e) {
e.printStackTrace();
}
return resultSet;
} |