Hi, I have created an interface which accepts the details of a person and stores it in database it also stores the id. Now what i need is if the details are entered more than 3 times then i should get a message that "U cant enter any more". So please some one give me an idea please its urgent.
That depends what fields you have and which ones are relevant for the uniqueness.
Suppose you have a first and last name, and these can only occur 3 times. Then the query would be
with Rob and Prime coming from your user interface. I would suggest using PreparedStatement though as it will prevent users entering bad values and thereby corrupting your datamodel. If you want more info on that, search for SQL injection on Google etc.
The return value of that query will have to be checked against the maximum number allowed.