How to Correctly Close Resources

前端 未结 6 1438
孤独总比滥情好
孤独总比滥情好 2020-12-09 16:48

As I was cleaning up some code, FindBugs pointed me to a bit of JDBC code that uses Connection, CallableStatement, and ResultSet objects. Here\'s a snippet from that code:

6条回答
  •  隐瞒了意图╮
    2020-12-09 17:34

    The only way I know to hide all that ugly try-catch boilerplate code is to utilize something like Spring's JBDC Template.

提交回复
热议问题