Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Clojure 如何将JDBC支持的数据库(Informix)添加到korma中_Clojure_Korma - Fatal编程技术网

Clojure 如何将JDBC支持的数据库(Informix)添加到korma中

Clojure 如何将JDBC支持的数据库(Informix)添加到korma中,clojure,korma,Clojure,Korma,我需要采取哪些步骤才能使我的Informix JDBC驱动程序成为korma中受支持的数据库?Informix有一个jdbc驱动程序,我已经用驱动程序的演示Java程序进行了测试。我的连接参数正常工作 我已经开始了一个Clojure项目,但我一直在尝试什么,甚至是得到一个错误,所以我可以从那里继续前进,更不用说连接了 我的InformixJDBC驱动程序3.50在maven中 mvn install:install-file \ -DgroupId=com.informix \ -Dartifa

我需要采取哪些步骤才能使我的Informix JDBC驱动程序成为korma中受支持的数据库?Informix有一个jdbc驱动程序,我已经用驱动程序的演示Java程序进行了测试。我的连接参数正常工作

我已经开始了一个Clojure项目,但我一直在尝试什么,甚至是得到一个错误,所以我可以从那里继续前进,更不用说连接了

我的InformixJDBC驱动程序3.50在maven中

mvn install:install-file \
-DgroupId=com.informix \
-DartifactId=ifxjdbc \
-Dversion=3.50 \
-Dfile=/opt/IBM/Informix_JDBC_Driver/lib/ifxjdbc.jar \
-Dpackaging=jar \
-DgeneratePom=true
以下示例适用于postgres。我想为Informix做这件事。我想知道我必须做些什么才能使用类似于

(defdb prod (postgres {:db "korma"
                       :user "korma"
                       :password "kormapass"
                       ;; optional keys
                       :host "myhost"
                       :port "4567"
                       :delimiters ""}))

我非常肯定,在上面的例子中,我不能仅仅用“informix”来代替postgres,神奇的事情将会发生。我只是不知道该创建什么定义。任何示例的帮助或提示都将不胜感激。

尝试使用
classname
subtocol
属性:

(def db-config {:classname "com.informix.jdbc.IfxDriver"
                :subprotocol "informix-sqli"
                :subname (format "//%s:1533/%s" 
                                 "123.45.67.89"
                                 "testDB:INFORMIXSERVER=myserver")
                :user "user"
                :password "password"})

(defdb db db-config)
看看不同的定义,
postgres
只是这些属性的简写。即使没有
informix
预定义的函数,您也可以使用自己的函数

根据驱动程序名为
com.informix.jdbc.IfxDriver
,您还可以在那里检查数据库URI:

The following example shows a database URL that connects 
to a database called testDB:

jdbc:informix-sqli://123.45.67.89:1533/testDB:INFORMIXSERVER=myserver;
user=rdtest;password-test
还要记住向
项目.clj
文件中添加适当的依赖项信息:

 :dependencies [...
                [com.informix.jdbc/com.springsource.com.informix.jdbc "3.0.0.JC3"]
                ...
以及该依赖项的springsource存储库:

  :repositories [["springsource-release" "http://repository.springsource.com/maven/bundles/release"]
                 ["springsource-external" "http://repository.springsource.com/maven/bundles/external"]]

如何找到我的驱动程序的类名?这是com/informix/jdbc/IfxDriver.class吗?那么,我同意你的看法,我可能会尝试使用postgres作为“模板”来代替Informix。根据我链接的文档,类名是com.Informix.jdbc。如果我仍然感到困惑的话。如果我应该使用informix jdbc驱动程序,那么我在线程“main”java.sql.SQLException中得到这个错误异常:没有找到适合jdbc的驱动程序:postgresql://steamboy:(:port opts)/stores7/ministores您指定了哪个子目录?它应该是
informix cli
请检查更新的
db config
很抱歉,它是informix sqli,还请将您的端口号更正为1533您现在有字符串
(:port opts)
,它将失败