it always shows the infobox that i am always failing to get the string value of password and password 1 to confirm if those two are the same and then if it is the same it will insert those values into my local database
@FXML
private void handleButtonActionRegister(ActionEvent event) {
String email = textUserRegister.getText();
String password = textRegisterPassword.getText();
String password1 = textRegisterPassword1.getText();
if (password != password1){
infoBox("Password doesn't match!", "Failed", null);}
else{
String sql = "INSERT INTO employee VALUES (?,?)";
try{
preparedStatement = dbconnect.prepareStatement(sql);
preparedStatement.setString(1, email);
preparedStatement.setString(2, password);
resultSet = preparedStatement.executeQuery();
Node source = (Node) event.getSource();
dialogStage = (Stage) source.getScene().getWindow();
dialogStage.close();
scene = new Scene(FXMLLoader.load(getClass().getResource("WelcomePage.fxml")));
dialogStage.setScene(scene);
dialogStage.show();
}catch(Exception e){e.printStackTrace();}}
}