Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8024619

JDBC java.sql.DriverManager is not usable from JS script

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • 8
    • core-libs
    • None
    • b108
    • generic
    • generic

    Description

      When a connection is established (calling DriverManager.getConnection) the driver is not resolved. Whatever the way the Driver is registered (system property, classloading and direct registration), connection is failing.

      When getConnection is called, the DriverManager retrieves the caller classloader (3 frames upper) and uses this classloader to load the driver. This is failing.

      A simple testcase based on derby driver, the getDrivers should return an enumeration containing 1 element, the returned enumeration is empty:

      var type = Packages.org.apache.derby.jdbc.ClientDriver;
      var tt = new type();
      Packages.java.sql.DriverManager.registerDriver(tt);
      print(Packages.java.sql.DriverManager.getDrivers().hasMoreElements());
        

      Attachments

        Activity

          People

            sundar Sundararajan Athijegannathan
            jfdenise Jean-Francois Denise (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: