Results 1 to 2 of 2

Thread: Easy syntax question...

  1. #1
    Join Date
    Feb 2006
    Posts
    2

    Easy syntax question...

    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

  2. #2
    Join Date
    Feb 2006
    Posts
    2
    Alright, nevermind. I forgot to add an 's' to the end of my field name 'userCodeS'. Man, I hate when i forget stupid things like that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •