aspose file tools*
The moose likes JDBC and the fly likes Too few parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Too few parameters" Watch "Too few parameters" New topic
Author

Too few parameters

Hilton Meyer
Greenhorn

Joined: Nov 13, 2003
Posts: 17
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


Keep it Tidy
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8900
    
    8

Post the error, please?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Hilton Meyer
Greenhorn

Joined: Nov 13, 2003
Posts: 17

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

Joined: Oct 29, 2001
Posts: 8900
    
    8

Try using single quotes rather than double-quotes in the query
Hilton Meyer
Greenhorn

Joined: Nov 13, 2003
Posts: 17
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Too few parameters