Foren
how to check the duplicate value insertion by the server side
mukesh kumar, geändert vor 11 Jahren.
how to check the duplicate value insertion by the server side
Junior Member Beiträge: 57 Beitrittsdatum: 13.03.12 Neueste Beiträge
Hi everyone
Supose i have inserted one field value into a database say firstname Bruno and we are inserting the same value ie Bruno into databse , It will throw error message by the server side . Duplicate value should not be inserted into database .
So can anybody please help me how to check the duplicate value insertion by the server side.
Please reply whatever idea you can suggest me .
Supose i have inserted one field value into a database say firstname Bruno and we are inserting the same value ie Bruno into databse , It will throw error message by the server side . Duplicate value should not be inserted into database .
So can anybody please help me how to check the duplicate value insertion by the server side.
Please reply whatever idea you can suggest me .
Rewati Raman, geändert vor 11 Jahren.
RE: how to check the duplicate value insertion by the server side
Junior Member Beiträge: 97 Beitrittsdatum: 24.02.12 Neueste Beiträge
Hi Mukesh,
you have posted your post in wrong category....
Mukesh can you upload your error log for better understanding and as per i understood your question you want to validate the database insertion at serverside and are you trying it for custom table or built-in table?
Regards,
Rewati Raman
you have posted your post in wrong category....
Mukesh can you upload your error log for better understanding and as per i understood your question you want to validate the database insertion at serverside and are you trying it for custom table or built-in table?
Regards,
Rewati Raman
Tanweer Ahmed ., geändert vor 1 Jahr.
RE: how to check the duplicate value insertion by the server side
Expert Beiträge: 322 Beitrittsdatum: 11.03.10 Neueste Beiträge
Hi Mukesh,
Write a Finder method By Name OR a Dynamic Query on your server side.
Check the name passed from the UI against those available in the Db.
Based on the data returned by your method, You can choose to Save the value in Db OR Skip saving.
Hope this helps.
Regards,
Tanweer,
LIUG Member
Write a Finder method By Name OR a Dynamic Query on your server side.
Check the name passed from the UI against those available in the Db.
Based on the data returned by your method, You can choose to Save the value in Db OR Skip saving.
Hope this helps.
Regards,
Tanweer,
LIUG Member
mukesh kumar, geändert vor 11 Jahren.
RE: how to check the duplicate value insertion by the server side
Junior Member Beiträge: 57 Beitrittsdatum: 13.03.12 Neueste Beiträge
@Tanweer Ahmed Ansari
Thanks for your suggestion..
I achieved my goal by implementing your idea...
Regards,
Mukesh Kumar.
Thanks for your suggestion..
I achieved my goal by implementing your idea...
Regards,
Mukesh Kumar.
Tanweer Ahmed ., geändert vor 1 Jahr.
RE: how to check the duplicate value insertion by the server side
Expert Beiträge: 322 Beitrittsdatum: 11.03.10 Neueste Beiträgemukesh kumar:
@Tanweer Ahmed Ansari
Thanks for your suggestion..
I achieved my goal by implementing your idea...
Regards,
Mukesh Kumar.
Mukesh, Happy 2 Help !!!
Regards,
Tanweer,
LIUG Member
mukesh kumar, geändert vor 11 Jahren.
RE: how to check the duplicate value insertion by the server side
Junior Member Beiträge: 57 Beitrittsdatum: 13.03.12 Neueste Beiträge
Hi Tanweer ,
Hope you are fine.
I have one more issue .
Can i achieve the same task in client side ?
Regards,
Mukesh
Hope you are fine.
I have one more issue .
Can i achieve the same task in client side ?
Regards,
Mukesh
Mazhar Alam, geändert vor 11 Jahren.
RE: how to check the duplicate value insertion by the server side
Regular Member Beiträge: 191 Beitrittsdatum: 25.11.11 Neueste Beiträge
The same way goes for the client side too..fetch the list and compare them with the inputted values...and based on this you can check duplicity..
mukesh kumar, geändert vor 11 Jahren.
RE: how to check the duplicate value insertion by the server side
Junior Member Beiträge: 57 Beitrittsdatum: 13.03.12 Neueste Beiträge
Hi Mazhar Alam,
Thanks for suggestion. But how i can write the jdbc connection code in javascript . Because we have to compare the input data with data which is available in database.
I am not sure whether it is possible to write the jdbc connection code in javascript . Can you please answer me.
Regards,
Mukesh Kumar
Thanks for suggestion. But how i can write the jdbc connection code in javascript . Because we have to compare the input data with data which is available in database.
I am not sure whether it is possible to write the jdbc connection code in javascript . Can you please answer me.
Regards,
Mukesh Kumar
Mazhar Alam, geändert vor 11 Jahren.
RE: how to check the duplicate value insertion by the server side
Regular Member Beiträge: 191 Beitrittsdatum: 25.11.11 Neueste Beiträge
Hi,
I dont think you can write javascripts for jdbc conn..that wont work..instead
-create a class then fetch the database values and then call it in your jsp page...then compare
I dont think you can write javascripts for jdbc conn..that wont work..instead
-create a class then fetch the database values and then call it in your jsp page...then compare
mukesh kumar, geändert vor 11 Jahren.
RE: how to check the duplicate value insertion by the server side
Junior Member Beiträge: 57 Beitrittsdatum: 13.03.12 Neueste Beiträge
Hi Mazhar Alam
Ya you are right . creating a class then fetching the database values and then calling it in your jsp page...then comparing . then it will be server side .Am i right ?
Regards,
Mukesh
Ya you are right . creating a class then fetching the database values and then calling it in your jsp page...then comparing . then it will be server side .Am i right ?
Regards,
Mukesh
Tanweer Ahmed ., geändert vor 1 Jahr.
RE: how to check the duplicate value insertion by the server side
Expert Beiträge: 322 Beitrittsdatum: 11.03.10 Neueste Beiträgemukesh kumar:
Hi Tanweer ,
Hope you are fine.
I have one more issue .
Can i achieve the same task in client side ?
Regards,
Mukesh
Hi Mukesh,
You cannot achieve this in client side.Since client codes are executed by the Browser and not by the Server.You will have to make a call to DB, fetch the values, then compare and then perform your logic.
Hope this helps,
Regards,
Tanweer,
LIUG Member
mukesh kumar, geändert vor 11 Jahren.
RE: how to check the duplicate value insertion by the server side
Junior Member Beiträge: 57 Beitrittsdatum: 13.03.12 Neueste Beiträge
thanks Tanweer .
i would like to discuss one more thing Whether it is possible through Ajax .
Regards,
mukesh
i would like to discuss one more thing Whether it is possible through Ajax .
Regards,
mukesh