Solved

Java and SQL

Posted on 2002-04-02
10
194 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
network + 7 80
Printing to a specific printer tray (HP 806dn printer) 3 83
mockito example issue 8 62
HSSFWorkbook cannot be resolved error 10 50
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now