接口 SmartDataSource

    • 方法详细资料

      • shouldClose

        boolean shouldClose​(Connection con)
        Should we close this Connection, obtained from this DataSource?

        Code that uses Connections from a SmartDataSource should always perform a check via this method before invoking close().

        Note that the JdbcTemplate class in the 'jdbc.core' package takes care of releasing JDBC Connections, freeing application code of this responsibility.

        参数:
        con - the Connection to check
        返回:
        whether the given Connection should be closed
        另请参阅:
        Connection.close()