From a35b9044a5bf26152f30bc4abe981bb7dd985e7b Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 19 Feb 2009 12:17:10 +0100 Subject: Depend on SQLiteJDBC. --- INSTALL | 6 +++++- cljssss-g.clj | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 14b595b..930c6d6 100644 --- a/INSTALL +++ b/INSTALL @@ -3,7 +3,7 @@ #title CljSSSS^g Quick Start Guide #desc The CljSSSS^g installation guide -; Time-stamp: <2009-02-18 20:31:12 mulk> +; Time-stamp: <2009-02-19 11:57:16 mulk> ; ; C-c i t insert-time-stamp ; C-c C-t muse-project-publish-this-file @@ -19,6 +19,8 @@ The following dependencies need to be on your class path: - Clojure + - Clojure Contrib + - Compojure along with all of its dependencies, including: - Fact - Jetty @@ -28,6 +30,8 @@ The following dependencies need to be on your class path: - StringTemplate along with ANTLR + - SQLiteJDBC + ---- diff --git a/cljssss-g.clj b/cljssss-g.clj index 435c6c5..c99a0df 100644 --- a/cljssss-g.clj +++ b/cljssss-g.clj @@ -1,9 +1,12 @@ (ns cljssss-g (require [clojure.xml :as xml] + [clojure.contrib.sql :as sql] compojure) (import (org.antlr.stringtemplate StringTemplateGroup)) (use compojure)) +(Class/forName "org.sqlite.JDBC") + (def templates (new StringTemplateGroup "")) (defservlet cljssss-g @@ -15,5 +18,12 @@ (ANY "*" (page-not-found))) +(defmacro with-db [& body] + `(sql/with-connection {:classname "org.sqlite.JDBC" + :subprotocol "sqlite" + :subname "cljssss-g.sqlite3"} + (sql/transaction + ~@body))) + (run-server {:port 8080} "/*" cljssss-g) -- cgit v1.2.3