You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/06/12 00:00:09 UTC
commons-dbcp git commit: Add missing Javadoc, better param names,
line length 120.
Repository: commons-dbcp
Updated Branches:
refs/heads/master 628e21fcc -> 00354024c
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/master
Commit: 00354024c64400dfaba80873e55fa365d45b1f9f
Parents: 628e21f
Author: Gary Gregory <ga...@gmail.com>
Authored: Mon Jun 11 18:00:07 2018 -0600
Committer: Gary Gregory <ga...@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) + "]";
}
}