Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

exception related to data constraint

Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a table that has "unique index" constraint --- for example the table has 10 columns. One of them is PK, I add another constraint that the combination of 5 columns has to be unique. Then when I use JDBC to insert a row, if it violates this constraint, what kind exception will be thrown ? will it be a regular SQL Exception or what ?

how do I know it is caused by this particular problem when an exception is thrown ?
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!