You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This interface may be implemented by a driver that wants to be notified by DriverManager when the driver is deregistered.
A DriverAction implementation is not intended to be used directly by applications. A JDBC Driver may choose to create its DriverAction implementation in a private class to avoid it being called directly.
The JDBC driver's static initialization block must call DriverManager.registerDriver(java.sql.Driver, java.sql.DriverAction) in order to inform DriverManager which DriverAction implementation to call when the JDBC driver is de-registered.
If there are active connections to the database at the time that the deregister method is called, it is implementation specific as to whether the connections are closed or allowed to continue. Once this method is called, it is implementation specific as to whether the driver may limit the ability to create new connections to the database, invoke other Driver methods or throw a SQLException.
It seems others do not implement this interface. They don't restrict any behaviour of already obtained JDBC connections. This affects only Java SPI ability. DriverAction is a recommendation if we want to be notified after the driver has been deregistered, so I don't see how we can use it now. It's worth closing the issue or moving it to another milestone
So it does not needed (at least for now) internally and is not a part of public API of a driver. I agree, it worth to close the issue and reopen if we'll need to know about deregistering.
This interface may be implemented by a driver that wants to be notified by DriverManager when the driver is deregistered.
A
DriverAction
implementation is not intended to be used directly by applications. A JDBCDriver
may choose to create itsDriverAction
implementation in a private class to avoid it being called directly.The JDBC driver's static initialization block must call
DriverManager.registerDriver(java.sql.Driver, java.sql.DriverAction)
in order to informDriverManager
whichDriverAction
implementation to call when the JDBC driver is de-registered.Example:
See more here.
The text was updated successfully, but these errors were encountered: