Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Jeff Cunningham   on Jan 22 In Java Category.

  
Question Answered By: Heidi Larson   on Jan 22

You don't want any message if a violation occurs???
If you're not, I think that the best way to do this is a stored procedure
directly from the database. Case your RDBMS does not supports procedures, I
suggest you to create a function "insert" and before the insert  use a "select
count(*) from table1 where col2 = id" statement  to check if the record exists.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on JDBC primary key doubt Or get search suggestion and latest updates.


Tagged: