Hi, I'm writing some queries using java.jdbc 0.3.3 as follows:
(defn get-member-url [id]
(jdbc/query db ["SELECT * FROM members WHERE id = ? LIMIT 1" id]))
However this results in an exception error:
java.lang.ClassCastException
clojure.lang.LazySeq cannot be cast to clojure.lang.IFn
Not sur
2014-02-15 7:55 GMT+04:00 The Dude (Abides) :
> However this results in an exception error:
>
> java.lang.ClassCastException
> clojure.lang.LazySeq cannot be cast to clojure.lang.IFn
>
Please post a complete stack trace.
--
MK
http://github.com/michaelklishin
http://twitter.com/michaelklishin
Make sure your db is correct,
see
http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html#setting-up-a-data-source
Show your db and id values.
Best,
Eduard
On Saturday, February 15, 2014 5:55:35 AM UTC+2, The Dude (Abides) wrote:
>
> Hi, I'm writing some queries using java.jdbc 0.3.3 as
Thanks, here's the entire stack trace:
java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to
clojure.lang.IFn
members.clj:33 sikhpyar.routes.members/get-member
members.clj:50 sikhpyar.routes.members/fn
core.clj:94 co
I spot invalid let here:
(defn get-a-member [id]
(let [id (parse-int id) member]
[member (memberdb/get-member id)]
should be
(defn get-a-member [id]
(let [id (parse-int id)
member (memberdb/get-member id)]
On Sunday, February 16, 2014 4:01:03 AM UTC+2, The Dude (Abides)
You're right :) When I isolated the issue thanks to some help it turns out
java.jdbc is working fine but I wasn't getting the resultset output
properly in the function. So got it resolved and working like this:
(defn get-member [id]
(let [id (parse-int id)
member (first (jdbc/query