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

BasicDataSource does not work with getConnection(String, String)

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Bugzilla Id:
      29963

      Description

      Using DBCP 1.2.1, I cannot get a BasicDataSource to work when credentials are
      not supplied. My application learns the username and password at runtime and
      as a result has to use getConnection(String, String). The problem seems to
      occur in the createDataSource() method.

      If a username and password are not supplied with the data source, they get
      logged as missing, which is fine, but in the absence of the username/password
      upon creation of the ConnectionPoolFactory, it bombs upon validation. Since
      createDataSource() is called without arguments regardless of the getConnection()
      method that is called, validateConnectionFactory(PoolableConnectionFactory)
      will always fail if the username and password are not supplied with the
      original data source configuration.

      My application runs outside of an application server. I am using Spring 1.0 and
      have tried HSQL and MySQL JDBC drivers. I can reproduce this error.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fiddlerpianist@yahoo.com Jonathan Whitall

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment