[
https://issues.apache.org/jira/browse/DBCP-547?focusedWorklogId=271736&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-271736
]
ASF GitHub Bot logged work on DBCP-547:
---------------------------------------
Author: ASF GitHub Bot
Created on: 03/Jul/19 17:11
Start Date: 03/Jul/19 17:11
Worklog Time Spent: 10m
Work Description: garydgregory commented on pull request #33: [DBCP-547]
Add a ConnectionFactory interface in BasicDataSource.createConnectionFactory()
URL: https://github.com/apache/commons-dbcp/pull/33#discussion_r300067186
##########
File path: src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
##########
@@ -1967,6 +1983,21 @@ public synchronized void setDriverClassName(final
String driverClassName) {
this.driverClassName = null;
}
}
+
+ /**
+ * Sets the ConnectionFactory class name.
+ *
+ * @param connectionFactoryClassName
+ *
+ */
+
+ public void setConnectionFactoryClassName(final String
connectionFactoryClassName) {
+ if (connectionFactoryClassName != null &&
connectionFactoryClassName.trim().length() > 0) {
Review comment:
Maybe even refactor into a private method `isNotBlank(String)` or
`isBlank(String)` and reuse in other places in this class.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 271736)
Time Spent: 1h (was: 50m)
> Add a ConnectionFactory Interface in BasicDataSource class
> ----------------------------------------------------------
>
> Key: DBCP-547
> URL: https://issues.apache.org/jira/browse/DBCP-547
> Project: Commons DBCP
> Issue Type: Improvement
> Affects Versions: 2.2.0
> Reporter: Lee Jun Gyun
> Priority: Minor
> Time Spent: 1h
> Remaining Estimate: 0h
>
> It think it would be nice better to implement a ConnectionFactory interface
> in BasicDataSource class or implement a interface in DriverConnectionFactory
> class.
> In my current project, when getting a connection in my program, I call
> oracleSetModule.
> so, i think that after creating connection, call oracleSetModule via
> connectionFactoryImpl seems to be nice.
>
> [Before]
> protected ConnectionFactory createConnectionFactory() throws SQLException {
> ...
> ...
> ConnectionFactory driverConnectionFactory =
> new DriverConnectionFactory(driverToUse, url, connectionProperties);
> return driverConnectionFactory;
> }
> [After]
> protected ConnectionFactory createConnectionFactory() throws SQLException {
> ...
> ...
> ConnectionFactory driverConnectionFactory =
> getConnectionFactoryImpl().newInstance(...);
> return driverConnectionFactory;
> }
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)