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

DriverManger not load driver auto in webApp

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_111"
      Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
      Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      doc of DriverManager for details:
      The DriverManager methods getConnection and getDrivers have been enhanced to support the Java Standard Edition Service Provider mechanism.

      when JEE container start,classpath not contain JDBCDriver's jar ,DriverManager be loaded in jvm,jvm init(execute static code):
          /**
           * Load the initial JDBC drivers by checking the System property
           * jdbc.properties and then use the {@code ServiceLoader} mechanism
           */
          static {
              loadInitialDrivers();
              println("JDBC DriverManager initialized");
          }
      But,when webapp deploy to container ,DriverManger has been loaded and inited,so,it can't load driver in webapp.
      when exec getConnection() ,not found driver,if or not exec loadInitialDrivers() again?


      REPRODUCIBILITY :
      This bug can be reproduced rarely.

        Attachments

          Activity

            People

            • Assignee:
              psonal Pallavi Sonal (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: