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 After UPDATE Statement, Null Value is fetched Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "After UPDATE Statement, Null Value is fetched" Watch "After UPDATE Statement, Null Value is fetched" New topic
Author

After UPDATE Statement, Null Value is fetched

Gaurav Wadhwani
Ranch Hand

Joined: Sep 21, 2010
Posts: 68
I made this code which simply fetches the data and each row has a Edit link Besides it...
When i click on Edit, the record appears perfectly, but when i make changes and click on save, it refreshes and shows null values in every Text Box. However, It makes changes to the Table.


This is the Code For EDIT page

Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 189

OK.

make a commit of first transaction before you fetch with the second statement.

con.commit();


SCJP 5, SCWCD 5
Gaurav Wadhwani
Ranch Hand

Joined: Sep 21, 2010
Posts: 68
thank you sir but that wont Solve the problem. This problem is combination of Java and SQL.

Initially i thought, it was Servlet only problem, then it became purely SQL problem, and then a Combination.

The complete solution is here

http://www.coderanch.com/t/510993/Servlets/java/Servlet-Displays-Old-DB-Entries

Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2343

Can you check the value of s during the refresh?


OCUP UML fundamental
ITIL foundation
Gaurav Wadhwani
Ranch Hand

Joined: Sep 21, 2010
Posts: 68
value of s remains same. When on Display List page, i click on edit and it attaches a parameter "value" which becomes the value of s. Then later on it stays in the servlet as hidden field and keeps passing no matter how many times i refresh it.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2343

Solved in http://www.coderanch.com/t/510993/Servlets/java/Servlet-Displays-Old-DB-Entries
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: After UPDATE Statement, Null Value is fetched
 
Similar Threads
not able to call the class file?
Getting Error in code
user authentication and dao
Why am i getting NullPointerException but runs properly
Servlet Displays Old DB Entries