Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java and SQL

Posted on 2002-04-02
10
Medium Priority
?
202 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
[X]
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
  • 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 20 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.
Suggested Courses

722 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