How to make JDBC SQLExceptions for DB2 more descriptive?

How to make SQLExceptions thrown by DB2 JDBC driver more descriptive? Currently I am getting this kind of exceptions. It is cumbersome to work with these cryptic SQLCODE and SQLSTATE numeric values. Is there a way where to make the SQL exception to contain code description. Caused by: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null at at at .... e.g. SQLSTATE 22001 has this description: > Character data, right truncation occurred; for example, an update or insert value is a string that is too long for the column, or a datetime value cannot be assigned to a host variable, because it is too small. Edit: I am also using Spring and Hibernate frameworks.
It would be great to check the solution for your question :-)

以上就是How to make JDBC SQLExceptions for DB2 more descriptive?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准