• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Too few parameters

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post the error, please?
 
Hilton Meyer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using single quotes rather than double-quotes in the query
 
Hilton Meyer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic