With the given Java code:

PreparedStatement ps = con.prepareStatement("SELECT userCode FROM accounts WHERE userCode = ?");
ps.setString(1, code);
ResultSet rs = ps.executeQuery();

...where 'code' is a string, I am getting the following error at compile time: 'Too few parameters. Expected 2.'

I think my syntax is correct. Can anyone tell me why I am getting this error?

Thank you.

Scott