Meaningless Drivel is fun!
The moose likes JDBC and Relational Databases 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 and Relational Databases
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: 51

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

Joined: May 26, 2003
Posts: 32481
    
214

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


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Sujoy Mukherjee
Ranch Hand

Joined: Dec 31, 2005
Posts: 51

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: 51

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: 20079
    
  30

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: executeUpdate() is not working
 
It's not a secret anymore!