File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes executeUpdate() is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "executeUpdate() is not working" Watch "executeUpdate() is not working" New topic
Author

executeUpdate() is not working

Sujoy Mukherjee
Ranch Hand

Joined: Dec 31, 2005
Posts: 46

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30382
    
150

If you run "select * from stars where job_id='AD_PRE'" at the sql command line, does it return anything?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Sujoy Mukherjee
Ranch Hand

Joined: Dec 31, 2005
Posts: 46

Nope. I have checked.....It has not been updated at all.
I don't know why??
Mahesh Gadgil
Greenhorn

Joined: Jun 16, 2011
Posts: 2
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

Joined: Dec 31, 2005
Posts: 46

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

Joined: Oct 27, 2005
Posts: 19684
    
  20

And you're absolutely sure there is a record in table "stars" with id 111111?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: executeUpdate() is not working