Author: jgrassel
Date: Mon Jul 17 15:07:25 2017
New Revision: 1802153

URL: http://svn.apache.org/viewvc?rev=1802153&view=rev
Log:
OPENJPA-2516: ConnectionProperties not being honor in Driver connect invocation 
(commit on wdazeys behalf)

Modified:
    
openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SimpleDriverDataSource.java

Modified: 
openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SimpleDriverDataSource.java
URL: 
http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SimpleDriverDataSource.java?rev=1802153&r1=1802152&r2=1802153&view=diff
==============================================================================
--- 
openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SimpleDriverDataSource.java
 (original)
+++ 
openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SimpleDriverDataSource.java
 Mon Jul 17 15:07:25 2017
@@ -81,8 +81,15 @@ public class SimpleDriverDataSource
     }
     
     protected Connection getSimpleConnection(Properties props) throws 
SQLException {
-       Connection con = getSimpleDriver().connect(_connectionURL, props == 
null? new Properties() : props);
-       if (con == null) {
+        Properties conProps = new Properties();
+        if (props != null) {
+            conProps.putAll(props);
+        }
+        if (_connectionProperties != null) {
+            conProps.putAll(_connectionProperties);
+        }
+        Connection con = getSimpleDriver().connect(_connectionURL, conProps);
+        if (con == null) {
             throw new SQLException(_eloc.get("poolds-null",
                     _connectionDriverName, _connectionURL).getMessage());
         }


Reply via email to