Use a database with Clojure

后端 未结 12 1582
青春惊慌失措
青春惊慌失措 2021-01-31 08:22

What methods to use a database from Clojure are there?

I know from Clojure you can do anything you can with Java, but that means that I may end up using something overly

12条回答
  •  星月不相逢
    2021-01-31 08:43

    If you need persistent connections and/or connections to multiple databases and do not want to reestablish connections every so often I would recommend using DB connection pools. Something like BoneCP or Tomcat CP.

    You can supply DataSources from those packages to (clojure.contrib.sql/with-connection ...).

提交回复
热议问题