wood burning stoves 2.0*
The moose likes JDBC and the fly likes executeUpdate  ODBC Too few parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "executeUpdate  ODBC Too few parameters" Watch "executeUpdate  ODBC Too few parameters" New topic
Author

executeUpdate ODBC Too few parameters

Brett Swift
Ranch Hand

Joined: May 22, 2002
Posts: 61

I have checked the SQL string, and it is valid, so its got to be part of the Java code.
I am using an Access2000 Database. And popped up a JOptionPane that gave the message:
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3.
sometimes says Expected 2.
I am confused as to what the problem is here? I have done some searches and I have found that it is usually a mis-spelled column name (ie Make would not be in the DB). however I have used the same SQL statement and put it right into Access and it worked fine!
I am using VisualAge 2.0, so i stepped through and took the exact sql from the debugger... I know the SQL is fine!
Dan Cranmer
Greenhorn

Joined: May 24, 2000
Posts: 24
You might want to check the parameters you pass to the getConnection method. The following is what we use for Oracle.

There should be some examples of how to use the MS database and jdbc.
[ August 02, 2002: Message edited by: Dan Cranmer ]
Brett Swift
Ranch Hand

Joined: May 22, 2002
Posts: 61
I have searched and my code seems to be fine, so it must be either a driver error, or something else.... I have tried PreparedStatements too, and that just gives other errors... check my other post
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Moving this to the JDBC forum.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: executeUpdate ODBC Too few parameters
 
Similar Threads
conditional select stmt problem in java servlet
DSN too long- ODBC Error. i've tried everything!
prepared Statement ODBC error MSAccess
Error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters.
Optional Feature Not Implemented -ODBC Error