• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

After UPDATE Statement, Null Value is fetched

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Ranch Hand
Posts: 198
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK.

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

con.commit();
 
Gaurav Wadhwani
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

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

 
Bartender
Posts: 2662
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
Can you check the value of s during the refresh?
 
Gaurav Wadhwani
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2662
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
Solved in https://coderanch.com/t/510993/Servlets/java/Servlet-Displays-Old-DB-Entries
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic