Solved

Java and SQL

Posted on 2002-04-02
10
196 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

776 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