This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JDBC and the fly likes sqlException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "sqlException" Watch "sqlException" New topic
Author

sqlException

kelly devon
Ranch Hand

Joined: Apr 15, 2004
Posts: 75
hi,

someone help me out here i am trying to update using my gui
an access database and i keep getting an SQLException which
says "SQLException too few parameters expected1"
and this is the line of code doing this
correction are welcomed thanks


kel
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Kelly,
With the exception it looks like the parameters you r passing are less as compared to what the query expects.

In the query
stat.executeupdate("UPDATE Stock"+"SET Qty(dbfieldname)="+ quantity(variable)+" "+WHERE Itemsno(dbfieldname)='"item+"'");


quantity(variable) is a field i guess which u r picking from GUI.
so it too must be in single quotes .

stat.executeupdate("UPDATE Stock"+"SET Qty(dbfieldname)='"+ quantity(variable)+"'"+WHERE Itemsno(dbfieldname)='"item+"'");

try this out

thanks,
Rajendar
kelly devon
Ranch Hand

Joined: Apr 15, 2004
Posts: 75
thx
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sqlException
 
Similar Threads
Best way to connect?
No ResultSet set was produced
Could not locate DB driver
Mysql Error Messages in Java
SQLException