Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQLException error code

807606Mar 16 2007 — edited Mar 16 2007
Sometimes you would want to base your decisions in your java code on the error code you get from the SQLException. Now unfortunately these error codes are vendor specific and are different for each vendor, e.g.



"unique constraint"
Oracle:: 1
MySQL:: 2300
Hypersonic:: 104

Now this raises a question as to how to handle such a situation? you dont want to change the code if the underlying database changes or if you are connecting to more than one DB. In our case we use hypersonic for unit tests and Oracle for actual deployment. Does the jdbcTemplate provide us with any help in this scenario?

Message was edited by:
kilyas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2007
Added on Mar 16 2007
2 comments
2,872 views