aspose file tools*
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

Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 298
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
Ranch Hand

Joined: Dec 16, 2010
Posts: 634

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.

"There is no reason for any individual to have a computer in his home" ~ Ken Olson, Co-founder of DEC, 1977
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60077

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

  • Hope they help!

    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    I agree. Here's the link:
    subject: How to update record in jsp
    Similar Threads
    when i retrive data from access it showing empty page in tomcat
    Problem in using date in WHERE clause in SELECT query in Servlet.
    Two actions in a single JSP
    Generate random id on an html page
    connecting jsp form with db but not connecting with it