String checkExpiryDate = "select expirydate from houseofdates.items where MONTH(expiryDate) ="
+ " MONTH(CURRENT_DATE()) AND YEAR(expiryDate) = YEAR(CURRENT_DATE())";
prepare = connect.prepareStatement(checkExpiryDate);
result = prepare.executeQuery();
if(result.next()){
expiryDate = result.getString("expirydate");
}
if(chckExpiry.matches(expiryDate)){
alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("Information Message");
alert.setHeaderText(null);
alert.setContentText("Item expiry date is " + chckExpiry );
alert.showAndWait();
}
I expect the expiry date to compare it to the present month and alert the user
New contributor
1