I am trying to execute a query that returns a student whose name and last name concatenated equal the search key parameter.
For that I am doing this in my class that man
Your problem is that you prepare the statement with
preparedStatement = dbConnection.prepareStatement(selectSQL);
which is correct, but then when you try to execute the PreparedStatement you supply the selectSQL
string again:
rs = preparedStatement.executeQuery(selectSQL);
That is incorrect. You've already prepared the statement, so when the time comes to execute it you just do
rs = preparedStatement.executeQuery();