Sharing connection pool between next.jdbc and

I’m currently using but would like to gradually shift over to next.jdbc. When my app starts, it uses Luminus’ conman to create a hikari-cp connection pool using the statement below.

    {:jdbc-url          (str "jdbc:mysql://" host
                             ":" port
                             "/" (ring.util.codec/url-encode name)
                             "?user=" (ring.util.codec/url-encode user)
                             "&password=" (ring.util.codec/url-encode password)
     :maximum-pool-size 5})

I can run a query against that pool. However, I can’t use the pool created with this statement to run a query through next.jdbc, I get the error

Execution error (ExceptionInfo) at next.jdbc.connection/spec->url+etc (connection.clj:199).
Unknown dbtype: 

Is it possible to somehow share a connection pool between the two jdbc libraries? By using a connection config that is compatible between both versions?

Yes, we share the connection pool between and next.jdbc at work. I have no idea what Luminus does or how conman works but I expect it creates a hash map containing :datasource and that is the connection-pooled datasource which c.j.j understands.

In order to work with next.jdbc, get the value of :datasource from that hash map and it should be a “native” JDBC DataSource object which is what next.jdbc expects.


Yes, (:datasource ...) worked, thanks!

FYI: Support more hash map formats · Issue #207 · seancorfield/next-jdbc ( has been implemented on develop and I’ll make a note here when I cut the next release (you can test it now via [com.github.seancorfield/next.jdbc “1.2.999-SNAPSHOT”] - Clojars).

1 Like

Cool, thanks!

com.github.seancorfield/next.jdbc {:mvn/version "1.2.790"} is available with support for :datasource (and :connection-uri) to make migration from c.j.j easier.

1 Like