Meaningless Drivel is fun!
The moose likes JSP and the fly likes JSP page refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP page refresh" Watch "JSP page refresh" New topic

JSP page refresh

Aarthi moorthy

Joined: Feb 24, 2003
Posts: 7
I wanted to refresh a JSP page after a row is inserted inoto a table...
I get
working after it get inserted.
But the values a not shown in thw page where i use a select statement to fetch the inserted row..
If i refresh the page i get two rows inserted in the table (duplicate of the first row)..
and the values are shown in the page....
help me plz..
Thanks in advance for ur halp...
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

My crystal ball tells me you are running MS Access as your database and using the jdbc dbc bridge as the driver.
Immediately after the insert and before you close the Connection, do a dummy select (ie select * from THE_SAME_TABLE where uid="")
If this is the problem you are having, it will fix the problem where the Driver caches queries and doesn't send them till the next one arrives.
This is only a guess! You're problem might be completely unrelated, in which case you'd have to drop some sample code for us to look at. DON'T post the whole thing!, just the important bits.
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 231

I presume there is no check on duplicate insertions hence as many inserts take place as number of refreshes (resulting in the JSP performing the insert routine. Check for existing data before insert using your Primary Key. But that still doesn't solve the problem of the results not being shown at all the first time for that I wud certainly have to look at yr JSP.

SCJP2, SCWCD 1.4, PMP, ITIL Foundation
I agree. Here's the link:
subject: JSP page refresh
jQuery in Action, 3rd edition