Skip to content

Instantly share code, notes, and snippets.

@hdenk
hdenk / jdbc.clj
Created August 21, 2011 15:37
noir framework: a middleware for jdbc-connection-handling (using c3p0 connection pool)
(ns my-web-app.middleware.jdbc
(:require
[clojure.java.jdbc :as jdbc]
[noir.options :as options])
(:import com.mchange.v2.c3p0.ComboPooledDataSource))
(defn- pooled-data-source
[db-connection-settings]
(let [cpds (doto (ComboPooledDataSource.)
(.setDriverClass (:classname db-connection-settings))
@hdenk
hdenk / build.gradle
Created February 8, 2011 03:37
clojure webapp with http-authentication using ring/moustache, deployable as foo.war
// gradle-build that uses meikel brandmeyers clojure-plugin for gradle (clojuresque)
// see http://bitbucket.org/kotarak/clojuresque
// use a standard maven directory-layout -> /src/main/clojure, /src/main/webapp
apply plugin: 'clojure'
apply plugin: 'war'
apply plugin: 'project-report'
warnOnReflection = false
aotCompile = true // needed for gen-class in servlet.clj