commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [20/50] [abbrv] commons-dbcp git commit: Add missing Javadoc, better param names, line length 120.
Date Wed, 13 Jun 2018 17:28:42 GMT
Add missing Javadoc, better param names, line length 120.

Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/00354024
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/00354024
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/00354024

Branch: refs/heads/release
Commit: 00354024c64400dfaba80873e55fa365d45b1f9f
Parents: 628e21f
Author: Gary Gregory <garydgregory@gmail.com>
Authored: Mon Jun 11 18:00:07 2018 -0600
Committer: Gary Gregory <garydgregory@gmail.com>
Committed: Mon Jun 11 18:00:07 2018 -0600

----------------------------------------------------------------------
 .../commons/dbcp2/DriverConnectionFactory.java  | 24 +++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/00354024/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java
index 09f02bf..4c2686c 100644
--- a/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 package org.apache.commons.dbcp2;
+
 import java.sql.Connection;
 import java.sql.Driver;
 import java.sql.SQLException;
@@ -31,19 +32,30 @@ public class DriverConnectionFactory implements ConnectionFactory {
     private final Driver driver;
     private final Properties properties;
 
-    public DriverConnectionFactory(final Driver driver, final String connectUri, final Properties
props) {
+    /**
+     * Constructs a connection factory for a given Driver.
+     * 
+     * @param driver
+     *            The Driver.
+     * @param connectString
+     *            The connection string.
+     * @param properties
+     *            The connection properties.
+     */
+    public DriverConnectionFactory(final Driver driver, final String connectString, final
Properties properties) {
         this.driver = driver;
-        this.connectionUri = connectUri;
-        this.properties = props;
+        this.connectionUri = connectString;
+        this.properties = properties;
     }
+
     @Override
     public Connection createConnection() throws SQLException {
-        return driver.connect(connectionUri,properties);
+        return driver.connect(connectionUri, properties);
     }
 
     @Override
     public String toString() {
-        return this.getClass().getName() + " [" + String.valueOf(driver) + ";" +
-                String.valueOf(connectionUri) + ";"  + String.valueOf(properties) + "]";
+        return this.getClass().getName() + " [" + String.valueOf(driver) + ";" + String.valueOf(connectionUri)
+ ";"
+                + String.valueOf(properties) + "]";
     }
 }


Mime
View raw message