Sorry this is such an ignorant question, but I am new to Clojure and the 
JVM. I am tring to find info about clojure.java.jdbc so I looked here:

http://corfield.org/blog/post.cfm/connecting-clojure-and-mysql

and saw this example:

(ns mysql.core
  (:require [clojure.java.jdbc :as sql]))

(def db {:classname "com.mysql.jdbc.Driver"
         :subprotocol "mysql"
         :subname "//localhost:3306/dbname"
         :user "dbuser"
         :password "secret"})

(defn list-users []
  (sql/with-connection db
    (sql/with-query-results rows
      ["select * from user"]
      (println rows))))

Can I assume that sql/with-connection does some magic in the background to 
manage the connection? I would not want the connection to get shut down, and 
then restarted, everytime I run a query. 





-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to