2014-03-06 2 views
1

이 질문은이 question의 후속 작업이지만 필자는 별도의 게시물을 정정하기에 충분하다고 느꼈습니다.내 Informix JDBC 드라이버를 알려주는 방법

Informix jdbc 드라이버를 인식하려면 어떻게 Clojure를 구성해야합니까? 나는 라이오닌을 사용하고있다.

나는 이것을 post으로 읽었지만 여전히 혼란 스럽다. My Informix JDBC 드라이버가 설치되어 있습니다. 나는이 방법으로 설치 : 나는 IBM (인포믹스) 지원에 말한

mvn install:install-file \ 
-DgroupId=com.informix \ 
-DartifactId=ufxjdbc \ 
-Dversion=3.50.JC9 \ 
-Dfile=/opt/IBM/Informix_JDBC_Driver/lib/ifxjdbc.jar \ 
-Dpackaging=jar \ 
-DgeneratePom=true 

을, 그리고 자신의 자바 데모 프로그램을 실행할 수있는 사실은 자신의 JDBC 드라이버가 제대로 작동을 의미합니다. 이 때문에 오류의

:

Exception in thread "main" java.sql.SQLException: 
No suitable driver found for 
jdbc:informix-sqli://steamboy:1498/stores7/ministores:INFORMIXSERVER=steamboy 

인포믹스 지원 내가 Clojure의가/leiningen 구성 할 필요가 있다고 생각, 그래서 인포믹스 JDBC 드라이버를 찾을 수 있습니다.

이 드라이버는 평범한 leiningen 종속 디렉토리에 없으며 Informix 지원에서는 Clojure의 클래스 경로에 드라이버를 가져 오는 것에 대해 설명했습니다. 나는 Maven에 설치하는 것을 의미한다고 생각했다. 내가 어떤 포인터 또는 도움을 주셔서 감사합니다 것

(ns db-test.core 

    (require [clojure.string :as str]) 
    (require [clojure.java.jdbc :as j]) 
    (:use [clojure.tools.cli]) 
    (:import java.util.Date) 
    (:gen-class) 
) 


(defn -main 
    [& args] 
    (def informix-db {:classname "com.informix.jdbc.IfxDriver" 
        :subprotocol "informix-sqli" 
        :subname (format "//%s:%s/%s:INFORMIXSERVER=%s" 
        (:host opts) 
        (:port opts) 
        (:database opts) 
        (:server opts)) 
        :user (:user opts) 
        :password (:password opts)}) 

     (let [customer-list 
     (j/query informix-db 
      ["select * from customer"])] 
      (doseq [customer customer-list] 
      (println customer)))))) 

(간결 감소)

project.clj

(defproject db-test "0.1.0-SNAPSHOT" 
    :description "Clojure database test" 
    :url "http://example.com/FIXME" 
    :license {:name "Eclipse Public License" 
      :url "http://www.eclipse.org/legal/epl-v10.html"} 
    :dependencies [[org.clojure/clojure "1.5.1"] 
       [org.clojure/tools.cli "0.1.0"] 
       [org.clojure/java.jdbc "0.3.3"]] 
    :main db-test.core) 

core.clj.

답변

1

당신은 당신의 project.clj 파일에 적절한 종속성 정보를 추가해야합니다

:dependencies [[com.informix.jdbc/com.springsource.com.informix.jdbc "3.0.0.JC3"]... 

그리고 의존성에 대한 스프링 소스 저장소를 찾을 수 :

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

감사합니다. 이것은 훌륭하게 작동합니다. 이제 다음 문제로 넘어갑니다. – octopusgrabbus

관련 문제