This query is not executed and the code going to catch block. ISSUE in Query May be in whileloop....
try {
getConnection();
String user = text.getText().trim();
String pass = password.getText().trim();
String query = "Select name,password from pharmacy.login where name = '" + user + "' and password = '" + pass + "'";
result = statement.executeQuery(query);
System.out.println("hii");
int count = 0;
while (result.next()) {
count++;
}
}