File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes How to update record in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to update record in jsp" Watch "How to update record in jsp" New topic

How to update record in jsp

Sudhir Pawar

Joined: Sep 27, 2012
Posts: 25
Below i have given my code in jsp which successfully retrieving values from oracle database based on form no. and showing into respective fields.
But now when i edit any value on this form and click on verify button to update edited values in database it updating successfully but not showing quickly after click on verify button it require either go back and come again on this form or click on refresh button in browser then it showing updated values.
So how can i update and shows values quickly.

Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 299
I think this topic is going to cause Bear Bibeault a heart attack.

First things first, you should not use Java code in JSPs, but even worst you should never access databases from a JSP, it is just wrong! I think it is a good idea to read a bit about MVC and Expression Language and beans and... well, a big bunch of things related on how to make a web application in Java.

But going back to your question, if you want to refresh elements in your page without refreshing the full page what you need is AJAX. Of course to use AJAX you must have your logic in the Server and not in the JSP itself.

Good luck!
J. Kevin Robbins

Joined: Dec 16, 2010
Posts: 1522

If Bear survives your 680+ line example, he'll be along soon with links to several articles you need to read, because you are seriously headed down the wrong path.

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

As predicted, here are the links:
  • The Secret Life of JSPs
  • The Front Man

  • Hope they help!

    [Asking smart questions] [About Bear] [Books by Bear]
    I agree. Here's the link:
    subject: How to update record in jsp
    It's not a secret anymore!