SQLException error code
807606Mar 16 2007 — edited Mar 16 2007Sometimes 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