Win a copy of Python Continuous Integration and Delivery this week in the Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

selecting a particular record from a derby table  RSS feed

 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table with a first column as ID (integer) and this column is the primary key

I do some calculations to decide which record I wish to retrieve
and end up with the following integer value variable called Candidate_ID

The table also has a column called Occurances (integer) which I wish to update by adding 1


I am getting an error on the first line of code
SQL State: 42X04
Error Code: 20000
Message: Column 'Candidate_ID' is either not in any table or................

What should I change in the first line ?

Bob M
 
Marshal
Posts: 24188
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bob Matthews wrote:and end up with the following integer value variable called Candidate_ID



If "Candidate_ID" is a variable in your Java code then you should change line 1 to a group of lines which use a PreparedStatement.

You already know how to do that because you've done it in lines 6, 8, and 9.
 
Bob Matthews
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Paul

Bob M
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!