Can I unregister drivers returned from DriverManager.getDrivers ()?

I'm working on a Java webapp that needs to be deployed among others in a common servlet container (Tomcat 7 in this case).

This cleanup code overrides all registered JDBC drivers (stored in a local variable in the Database Connection Manager).

But if I call DriverManager.getDrivers()

after that, I see that other drivers are still coming back.

Is it possible to unregister them as well, or does this method return drivers registered by other applications in the same servlet container (Tomcat in this case)?

+3


source to share


1 answer


If Tomcat is not complaining about a memory leak due to one of the registered drivers, leave them alone. If Tomcat complains, then, assuming nothing else is using them, the log warning (s) are canceled.



+1


source







All Articles