This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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 ..so 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.. Operation 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.. ..so 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 sandeep
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. bye abhinav [This message has been edited by Abhinav Sharma (edited November 22, 2001).]
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. ~Kumar ------------------ Sun Certified Programmer for the Java�2 Platform