Created
July 22, 2013 19:56
-
-
Save gfredericks/6057073 to your computer and use it in GitHub Desktop.
Reading postgres arrays in java.jdbc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(extend-protocol IReadResult | |
java.sql.Array | |
(read-result [sqlarray] | |
(let [rs (.getResultSet sqlarray)] | |
(loop [rows []] | |
(if (.next rs) | |
(recur (conj rows (.getObject rs 2))) | |
rows))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment