Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-503

Documentation should recommend using .newInstance() to instantiate JDBC driver

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.1.1.0
    • 10.5.1.1
    • Documentation
    • None

    Description

      Using Class.forName("<driver name>").newInstance() is the recommended way to load and instantiate the JDBC driver, but the documentation does not contain the .newInstance() part.

      Pointers:

      http://db.apache.org/derby/docs/10.1/devguide/cdevdvlp40653.html
      http://db.apache.org/derby/docs/10.1/ref/rrefjdbc32052.html

      The EmbeddedDriver javadoc mentions it:

      "The JDBC specification recommends the Class.ForName method without the .newInstance() method call, but adding the newInstance() guarantees that Derby will be booted on any Java Virtual Machine."

      Attachments

        1. DERBY-503.diff
          19 kB
          Camilla Haase
        2. DERBY-503.stat
          0.4 kB
          Camilla Haase
        3. DERBY-503.zip
          23 kB
          Camilla Haase
        4. DERBY-503-2.diff
          19 kB
          Camilla Haase
        5. DERBY-503-2.zip
          23 kB
          Camilla Haase

        Issue Links

          Activity

            People

              chaase3 Camilla Haase
              bakksjo Oyvind Bakksjo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: