Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Too few parameters

 
Hilton Meyer
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
the problem I'm having seems to be a common one amoung newbies to the java JDBC world but here it goes again. I'm getting the error that I have to few parameters and I'm aware that it means there's something wrong with my code. I have checked the SQL in Access and it world perfectly. I don't know if I'm doing something worng in the implementation of the database. Please could someone take a look and point me in the right direction. Thanks
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the error, please?
 
Hilton Meyer
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The error it kicks out is :
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
I've taken the SQL into Microsoft and it workd there so I'm not sure if there is something that I'm missing in terms of java code. I'm pretty new to this stuff so I really am not sure if I've left something out. The initial connection works when the class is initialized but once I press the command button to generate the result it bombs out.
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using single quotes rather than double-quotes in the query
 
Hilton Meyer
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured out the problem. I was trying to use double quotes instead of simply single quotes. I come from a VB background so just got the syntax a bit wrong
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic