Class JdbcLeakPrevention


  • public class JdbcLeakPrevention
    extends java.lang.Object
    This class is loaded by WebappClassLoaderBase to enable it to deregister JDBC drivers forgotten by the web application. There are some classloading hacks involved - see WebappClassLoaderBase.clearReferences() for details - but the short version is do not just create a new instance of this class with the new keyword. Since this class is loaded by WebappClassLoaderBase, it cannot refer to any internal Tomcat classes as that will cause the security manager to complain.
    • Constructor Summary

      Constructors 
      Constructor Description
      JdbcLeakPrevention()
      Constructs a new JdbcLeakPrevention.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> clearJdbcDriverRegistrations()
      Clear JDBC driver registrations to prevent memory leaks.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JdbcLeakPrevention

        public JdbcLeakPrevention()
        Constructs a new JdbcLeakPrevention.
    • Method Detail

      • clearJdbcDriverRegistrations

        public java.util.List<java.lang.String> clearJdbcDriverRegistrations()
                                                                      throws java.sql.SQLException
        Clear JDBC driver registrations to prevent memory leaks.
        Returns:
        the list of driver names that were deregistered
        Throws:
        java.sql.SQLException - if a database access error occurs