programmatically checking for open connection in JDBC

前端 未结 4 1009
无人共我
无人共我 2020-12-18 05:26

How do I check for an open connection in jdbc for oracle database?

Note: conn.isClosed() cannot be used for this.

4条回答
  •  庸人自扰
    2020-12-18 05:54

    See this posting.

    The referenced solutions are similar to the one posted here (quick query against DUAL to validate) but there is also an interesting solution provided by JBoss specific to Oracle using the proprietary PING method in the Oracle JDBC Connection class. See the code here.

    //Nicholas

提交回复
热议问题