This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a problem while retrieving the data from a table. The code gives correct result when run for the first time then if the table 'Demo' is changed using the SQL editor the subsequent retrievals give the old data and not the new one. Can anyone reply where i have got it wrong?. Thanks in advance.
Try closing the resultset before closing the connection. close the connection in the finally block.
Joined: Nov 22, 2004
Hello, Thank you bijoy bose and kalpana Kumar.
I finally solved the problem. There was no problem in the code as such, but the problem was with my sql plus (for Oracle) which was showing the data as updated even though it has not updated. Infact only that editor showed that data is updated and not the table in reality. No wonder my code always returned the data which is actually as in the table and not as in the editor. Thank you friends once again for giving suggetions. And as you told closing the connection in the finally block that too after closing the result set is a good way to code. Thanks a lot.