Sonar: “Close this PreparedStatement”

后端 未结 2 826
情书的邮戳
情书的邮戳 2021-01-22 02:30

Why is SonarQube plugin for Jenkins complaining about the open statement if I close it in the finally block?

(I need to validate database connections in a separate funct

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-22 03:23

    I donnot see the point of putting all this nested try blocks with no catch. You need only the first try with the suitable catch and finally where you close your statments and connection after checking them against null.

提交回复
热议问题