The ResultSet obtained in the above lines of code would not be pointing to the results obtained from the query. So in order to make it point to the first set of results, you would have to call rs.next()
Alternatively, you can alter the query/code as follow:
But with if it works, like I have that two String the name and the password, and when I input them, they are right, no problems, the connection is OK .
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad: