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

updating database records via jsp

Joseph Rudman

Joined: Mar 26, 2006
Posts: 13

I'm creating an application which enables a user to view client data stored in a mysql database.

A servlet takes in username/login and if correct user is taken to jsp that displays the first record - user can then select next, user will then be taken to another jsp displaying next record, and on this jsp user can then view next or previous records.

But user should also be able to update the client data shown to user.

So I was going to add an update button to jsp's and when user updated any field on jsp displayed to user - he/she would then hit update button which would trigger updates in database using relevant sql, but how would I redisplay the same jsp with updated fields.

Currently if user hits any submit button he/she is taken to another field which displays the next record as follows:
<FORM method="POST" action="/ProcessClientsThen.jsp">

so basically what i'm asking is how would I get the jsp to refresh showing updated database informattion if user hits the Update submit button.
thanks Joe.
Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146
You wanted something that will refresh your JSP page. Hmmm. I am giving a little code here. This JSP refreshes itself automatically every 5 seconds.

You can force refresh by this line :

So what you can do, is to reduce the refresh time and put in your page. So your JSP will always show the latest data.

Tell me if this helps.

I agree. Here's the link:
subject: updating database records via jsp
It's not a secret anymore!