Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Java and SQL

Posted on 2002-04-02
10
198 Views
Last Modified: 2010-03-31
I am inserting, selecting and trying to update information from java to a MS Access database. However when updating this integer value into a field in the database, i receive an error saying "Too few Parameters, Expected 1"

from this statement : statement.executeUpdate("UPDATE ChildResults SET ChildIDNumber = " + getid + " WHERE ChildID = " + getid + "");

Thank you
0
Comment
Question by:Codster
  • 9
10 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 6914437
 From http://support.microsoft.com/default.aspx?scid=kb;EN-US;q216425

"
Too few parameters. Expected 1.

CAUSE
This error occurs only with Microsoft Access when one of the column names specified in a select statement does not exist in the table being queried."

  Hope it helps.
0
 

Author Comment

by:Codster
ID: 6914448
Yes the ChildID field is in a different tabel but a one to one relationship exists between the tables??????
0
 
LVL 35

Accepted Solution

by:
girionis earned 10 total points
ID: 6914535
 I do not know how well Access maps tables to each other. I have hardly used it. What you could do is to explicitly call the ChildID from the other table by providing the other table's name. For instance:

tatement.executeUpdate("UPDATE ChildResults SET ChildIDNumber = " + getid + "
WHERE <other table name>.ChildID = " + getid + "");

  Hope it helps.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 35

Expert Comment

by:girionis
ID: 6914540
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
LVL 35

Expert Comment

by:girionis
ID: 6914547
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
LVL 35

Expert Comment

by:girionis
ID: 6914548
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
LVL 35

Expert Comment

by:girionis
ID: 6914551
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
LVL 35

Expert Comment

by:girionis
ID: 6914553
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
LVL 35

Expert Comment

by:girionis
ID: 6914555
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
LVL 35

Expert Comment

by:girionis
ID: 6914557
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to implement Singleton Design Pattern in Java.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question