Skip to content

Instantly share code, notes, and snippets.

@canweriotnow
Created September 4, 2012 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canweriotnow/2a2e87c24e495cf340f5 to your computer and use it in GitHub Desktop.
Save canweriotnow/2a2e87c24e495cf340f5 to your computer and use it in GitHub Desktop.
JDBC Clojure output
(defn bbts-dev []
{ :classname (get-property "acedia.bbts")
:subprotocol (get-property "acedia.bbts.subprotocol")
:subname (str "@" (get-property "acedia.bbts.dev.host") ":" (get-property "acedia.bbts.dev.port") ":" (get-property "acedia.bbts.dev.sid"))
:user (get-property "acedia.bbts.dev.user")
:password (get-property "acedia.bbts.dev.password")})
user => (bbts-prod)
{:classname "oracle.jdbc.driver.OracleDriver", :subprotocol "oracle", :subname "@hostname:1521:bbts", :user "user", :password "pass"}
user=> (with-connection bbts-dev (with-query-results rs ["select * from customer where rownum < 10"] (dorun (map #(println (:firstname %)) rs))))
java.lang.IllegalArgumentException: db-spec acedia.config$bbts_dev@2123baa0 is missing a required parameter (NO_SOURCE_FILE:0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment