Hi all I just want to add some functionality in my project. I simply need that when a user enters some details then based on some specific column values if the value entered by user already exists in the database then message should be displayed. if i use primary key then an exception is thrown by SQLException class. I want to check it by myself through coding whether the values entered by user already exists or not.
Thanx in advance
Gaurav arora
0
Junior Poster in Training
Recommended Answers
Jump to PostThen you would need to run a query to see if the details existed ..
Jump to PostLizR is correct. Run a query on your columns to check if it exists, from the database side, you can also add a unique constraint on those columns to ensure that a sqlexception will be thrown if you try to do a insert on an already existing record with the …
All 8 Replies
LizR
171
Posting Virtuoso
dickersonka
104
Veteran Poster
LizR
171
Posting Virtuoso
Gaurav arora
0
Junior Poster in Training
LizR
171
Posting Virtuoso
Gaurav arora
0
Junior Poster in Training
LizR
171
Posting Virtuoso
Gaurav arora
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.