Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP page refresh

 
Aarthi moorthy
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to refresh a JSP page after a row is inserted inoto a table...
I get
out.print("inserted");
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...
regards,
Aarthi.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Dave
 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic