Commits

Shantanu Kumar  committed 159d1d5

fix passing of properties data to set-connection-properties! function
add test data for setting connection property

  • Participants
  • Parent commits f43d033

Comments (0)

Files changed (2)

File src/main/clj/org/bituf/clj_dbcp.clj

   [^BasicDataSource datasource props]
   ;; set-max-active!
   (when (contains? props :max-active)
-    (let [v (:max-active props)]
-      (when *show-jdbc-url* (println ":max-active" (pr-str v)))
-      (set-max-active! datasource (Integer/parseInt v))))
+    (let [v (:max-active props)
+          i (Integer/parseInt v)]
+      (when *show-jdbc-url* (println ":max-active" i))
+      (set-max-active! datasource i)))
   ;; set-min-max-idle!
   (when (and (contains? props :min-max-idle))
     (let [[ms mx] (sr/split (:min-max-idle props) #",")]
   ;; set-validation-query!
   (when (contains? props :validation-query)
     (let [v (:validation-query props)]
-      (when *show-jdbc-url* (println ":validation-query" v))
+      (when *show-jdbc-url* (println ":validation-query" (pr-str v)))
       (set-validation-query! datasource v)))
   ;; add-connection-property!
   (when (contains? props :conn-properties)
     (let [v (:conn-properties props)]
-      (when *show-jdbc-url* (println ":conn-properties" v))
-      (add-connection-property! datasource )))
+      (when *show-jdbc-url* (println ":conn-properties" (pr-str v)))
+      (add-connection-property! datasource v)))
   datasource)
 
 

File test-clj-dbcp.properties

 mysql.database=bituf
 mysql.username=root
 mysql.password=root
+mysql.conn-properties=connectTimeout=1000, socketTimeout=500
 
 # CUBRID credentials
 # hostport is supposed to be in the form "localhost:33000"