Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

executeUpdate ODBC Too few parameters

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the JDBC forum.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic