You have some logical mistakes in your SQL statements
I think
you should substitute OR with AND to get the desired effect or even remove the lines with wildcards alltogether.
You can do the same for your other problematic statement.
There is no need to list all parameters, just the ones you need to narrow the results:
This will return just one entry, the first one you added to the table with patient_id 1. If you were to alter the statement and use OR in such a way:
Two entries would be returned.
(1,1,'Test','Hello','test@test.com',5); and
(2,1,'Testing','Hello','test@test.com',4)
the first one matches the firstName equality and the second one the lastName equality.
As for your PreparedStatement error, you have to be careful of the types that you're setting to replace your placeholders. Title, and nationality are numbers, and you should be using
setInt() method. I think it should look something like this:
Be careful counting the '?' and what values you assign.
Hope this helped you.
Martin