clojure.java.jdbc

A Clojure wrapper for JDBC-based access to databases.

Formerly known as clojure.contrib.sql.

Releases and Dependency Information

Latest stable release: 0.2.0

Leiningen dependency information:

[org.clojure/java.jdbc "0.2.0"]

Maven dependency information:

<dependency>
  <groupId>org.clojure</groupId>
  <artifactId>java.jdbc</artifactId>
  <version>0.2.0</version>
</dependency>

Example Usage

(require '[clojure.java.jdbc :as sql])

(def mysql-db {:subprotocol "mysql"
    :subname "//127.0.0.1:3306/clojure_test"
    :user "clojure_test"
    :password "clojure_test"})

(sql/with-connection mysql-db
    (sql/insert-records :fruit
        {:name "Apple" :appearance "rosy" :cost 24}
        {:name "Orange" :appearance "round" :cost 49}))

(sql/with-connection mysql-db
    (sql/with-query-results rows
        ["SELECT * FROM fruit WHERE appearance = ?" "rosy"]
        (:cost (first rows))))

For more detail see the generated documentation on github.

Developer Information

Change Log

Copyright and License

Copyright (c) Stephen Gilardi, Sean Corfield, 2011-2012. All rights reserved. The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.