This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

selecting a particular record from a derby table  RSS feed

 
Ranch Hand
Posts: 181
  • 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
 
Sheriff
Posts: 23963
50
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: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Paul

Bob M
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!