我尝试使用 jdbc 从数据库中查询数据。问题是某些列是数组类型。
;get that particular column
(def jdbc-array (with-connection *db*
(with-query-results rs ["select * from refgene limit 5"]
(:exonstarts (first rs)))))
;Check if it has a value
(print jdbc-array)
;#<Jdbc4Array {67075873,67078739,67085754,67100417,67109640,67113051,67129424,67131499,67143471,67162932}>nil
;check class
(class jdbc-array)
;org.postgresql.jdbc4.Jdbc4Array
如何将此数组转换为 clojure 中的 seq/vector ?我试过 (seq jdbc-array) 和 (seq (.getArray jdbc-array) 但两者都不起作用......