• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP page refresh

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 250
Python Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic