Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-258

[PATCH] ManualPoolingDriverExample - more direct construction of driver and minor comment fix

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.2
    • 1.3
    • None

    Description

      This example has a very indirect way of registering the driver and getting it from the DriverManager.

      Class.forName("org.apache.commons.dbcp.PoolingDriver");
      PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");

      It is much more direct and clearer to do the following

      PoolingDriver driver = new PoolingDriver();
      DriverManager.registerDriver(driver);

      -------

      There were some missing backslashes in the comments about running the example

      Attachments

        Activity

          People

            Unassigned Unassigned
            petermichaux Peter Michaux
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified