Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RESULTSET PROBLEM

 
manoj kumar jena
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,here is my problem.
i inserted one row into database through JDBC code. then i deleted that record with the help of an SQL query.Now,in JDBC i am trying to fetch all the record from the table and from RESULTSET i am populating those data onto my form. BUT HERE IT IS GIVING THE OLD RECORD ALSO(WHICH I DELETED) WHENEVER I RUN SQL QUERY I AM NOT GETTTING THAT DELETED RECORDS BUT WHEN I'M FETCHING THE DATA FROM RESULSET I AM GETTING THAT RECORD.
PLEASE HELP ME, WHAT COULD BE THE REASON.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your sql client auto commit?
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be possible for you to post some code with the said problem?

That would help us a lot in trying to figure out the problem.

Thanks.
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
some code might help us to understand more.
thanks.
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then i deleted that record with the help of an SQL query
Are you shure that the delete statement is correct? Does it actualy delete the record?

And if you execute the delete in an sql tool - as Paul said - do you commit after executing the delete? And after the insert?
 
manoj kumar jena
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THANK YOU VERY MUCH TO ALL OF YOU FOR YOUR QUICK RESPONSE.
I SOLVED THAT PROBLEM WITH THE HELP OF UPDATEABLE RESULTSET AND REFRESHROW METHOD.

ONE OF THE BEST FORUM I HAVE EVER COME ACROSS.
JAVARANCH ROCKS.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manoj,
Great! For future posts, please turn off caps lock so it doesn't look like you are shouting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic