   ;;=========
   (get-sql    [template] (.-sql template))
   (set-params [template ^PreparedStatement prepared-statement params]
-    (set-params! prepared-statement ^objects (.-param-keys template) ^bytes (.-param-types template) params))
+    (cond
+      (map? params)    (set-params-map! prepared-statement (.-param-keys template) (.-param-types template) params)
+      (vector? params) (set-params-vec! prepared-statement (.-param-types template) params)
+      (nil? params)    nil
+      :otherwise       (expected "map, vector or nil" params)))
   (read-col   [template ^ResultSet result-set ^long column-index]
     (let [^bytes types (.-result-types template)]
       (if (pos? (alength types))



;; ----- error reporting -----


(defn illegal-arg

  ;;===========
  (get-sql    [m] (:sql m))
  (set-params [m ^PreparedStatement prepared-statement params]
    (cond
      (map? params)    (if-let [param-keys (:param-keys m)]
                         (let [param-types (or (:param-types m) (no-param-type-vec (count param-keys)))]
                           (set-params-map! prepared-statement param-keys param-types params))
                         (expected "key :param-keys to be present" m))
      (vector? params) (if-let [param-types (or (:param-types m) (when-let [param-keys (:param-keys m)]
                                                                   (no-param-type-vec (count param-keys))))]
                         (set-params-vec! prepared-statement param-types params)
                         (set-params-vec! prepared-statement params))
      (nil? params)    nil
      :otherwise       (expected "map, vector or nil" params)))
  (read-col   [m ^ResultSet result-set ^long column-index]
    (if-let [types (:result-types m)]
      (let [column-type (get types (unchecked-dec column-index))]
