Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executeUpdate() is not working

 
Sujoy Mukherjee
Ranch Hand
Posts: 51
Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends, I have a problem with my jdbc code.
I am using Oracle 10G Express edition.
I have a table named stars.
The ddl statement was:


Ans the code is:


The output is showing as
No. of rows updated: 0
I am simply clueless. please help me.
Thanks in advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you run "select * from stars where job_id='AD_PRE'" at the sql command line, does it return anything?
 
Sujoy Mukherjee
Ranch Hand
Posts: 51
Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope. I have checked.....It has not been updated at all.
I don't know why??
 
Mahesh Gadgil
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stars table does neither have job_id nor job_title as fields, but you are using them in your prepared statement?
Include the update code in try catch block so you can see the exception thrown.
 
Sujoy Mukherjee
Ranch Hand
Posts: 51
Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops! My apology. Thanks Mahesh.
Actually when I was unable to update data on stars table I was trying that code with jobs table but the result was same that means no updation happened to jobs table also. So when i was posting the code mistakenly I has copied the last code where jobs table was used.

Anyway I have modified the code for stars table using try catch block. Have a look:


The output is:
No. of rows updated: 0 Connection closed

Still its not working.

 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you're absolutely sure there is a record in table "stars" with id 111111?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic