johng       2002/12/20 15:19:31

  Modified:    java/src/org/apache/xalan/lib/sql DefaultConnectionPool.java
  Log:
  Fixed createConnection method for JDK1.4
  Tested with 1.4.1
  
  Revision  Changes    Path
  1.14      +9 -4      
xml-xalan/java/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
  
  Index: DefaultConnectionPool.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultConnectionPool.java        20 Dec 2002 18:59:51 -0000      1.13
  +++ DefaultConnectionPool.java        20 Dec 2002 23:19:31 -0000      1.14
  @@ -79,7 +79,7 @@
      * A placeholder thast will keep the driver loaded
      * between calls.
      */
  -  private Object m_Driver = null;
  +  private Driver m_Driver = null;
     /**
      */
     private static final boolean DEBUG = false;
  @@ -438,8 +438,9 @@
     {
       Connection con = null;
   
  -    // Create a Connection
  -    con = DriverManager.getConnection( m_url, m_ConnectionProtocol );
  +    // Create a Connection directly from the Driver that was loaded
  +    // with the context class loader. This is to support JDK1.4
  +    con = m_Driver.connect(m_url, m_ConnectionProtocol );
   
       return con;
     }
  @@ -495,8 +496,12 @@
   
           // We have also had problems with drivers unloading
           // load an instance that will get freed with the class.
  -        m_Driver = cls.newInstance();
  +        m_Driver = (Driver) cls.newInstance();
   
  +        // Register the Driver that was loaded with the Contect Classloader
  +        // but we will ask for connections directly from the Driver
  +        // instance
  +        DriverManager.registerDriver(m_Driver);
   
        }
        catch(ClassNotFoundException e)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to