Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

RESULTSET PROBLEM

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your sql client auto commit?
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
some code might help us to understand more.
thanks.
 
Bartender
Posts: 2660
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 40912
840
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Manoj,
Great! For future posts, please turn off caps lock so it doesn't look like you are shouting.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic