I have an application with a login form. What I want is simply retrieve the credentials of the user who logs in, i.e select the username and password from the login form and make a simple select query. However the resultset always return null, no matter what changes I made. I would like to ask what could be the problem? For the purpose of testing I have made 2 static variable in which I store the retrieved username and password (I will made the other alongside these fields in 1 class User but after I fix this). Here is the code: /The fields in the database are exactly like the ones written in the brackets of the getString() method/

```
package graphical_interface;
import business_logic.User;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Controller {
    @FXML
    public Button loginB;
    public Button exitB;
    public TextField userinp;
    public TextField passinp;
    public Parent pr;
    public static String s1 = null;
    public static String s2 = null;
    @FXML
    private void closeApp() {
        Platform.exit();
    }
    String username = null;
    String password = null;
    @FXML
    private void checkB(){

            try {
                PreparedStatement pstmt2 = null;
                Class.forName("com.mysql.jdbc.Driver");
                Connection conn = DriverManager.getConnection("jdbc:mysql://remotemysql.com/CXcocPWj6l", "CXcocPWj6l", "czNrEV9umD");
                String query  = "select * from User where Username = ? and PassWord = ?";
                pstmt2.setString(1,userinp.getText());
                pstmt2.setString(2,passinp.getText());
                ResultSet valueExist = pstmt2.executeQuery(query);
                if(valueExist.next()){
                    s1 = valueExist.getString("Username");
                    s2 = valueExist.getString("PassWord");
                   // System.out.println(valueExist.getString("PassWord");
                }
                conn.close();
                System.out.println(s1);
                System.out.println(s2);

            } catch (Exception exp){
                System.out.println(exp.getLocalizedMessage());
            }
    }
}

```