Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

JSP include

Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello evry one
Iam having a problem ..that when I insert a record using a jsp form Iam generating a uniwue number using oracle sequence...
after submitting i have to show him that u r unique no is this I am taking user to a jsp which is selecting from the database Unique no associated with his data..
Iam using Jsp include for that..
1)user enter data in form
2)user gets a Jsp page saying u R form is inserted an du R Unique no is this..
Iam using jsp include and passing parameter to other jsp when ever a form is submitted..if I refresh that page it inserts once again.. I want to know that how can I provide user a unique ID as soon as he enters his form..leaving the method Iam using
same as java ranch is using when ever we insert a post it takes us to a page saying u r message has been posted..
pls check it
bye and take care
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sandeep,
Whatever i have understood from your problem. I think probably you are using database oracle. But the table which you have made in database, you haven't made that field a primary key. So whenever you insert data through that jsp form inserts the value with no problem. What you should do is Make a table and make that id as unique or primary key. So whenever you will try insert a values through that jsp form. It will generate an exception and to handle that exception you have to use exception handler in your next jsp file where you are generating the record. You can get your id by this "request.getParameter("id"). Here id is the name of the input field which you have in the previous file. I hope this will help you.
[This message has been edited by Abhinav Sharma (edited November 22, 2001).]
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If ur Using a Sequence to generate the Unique numbers(as u said) this is should be a problem. coz, every time just before inserting u should take the sequence no. and place in that unique field(may be the primary key as abhinav said).
Check whether u r taking the Unique no. from the Sequence every time just before the insertion.
Sun Certified Programmer for the Java�2 Platform
ice is for people that are not already cool. Chill with this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic