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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8
    • Component/s: core-libs
    • None
    • b108
    • generic
    • generic

      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());
        

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

              Created:
              Updated:
              Resolved: