title: Oracle database in Clojure
body: <p>I 've been trying to get connection to Oracle database from Clojure but without success. My project.clj file:</p>
  
  <pre><code>(defproject db-examples "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
          :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
               [yesql "0.5.2"]
               [org.clojure/java.jdbc "0.4.2"]
               [org.postgresql/postgresql "9.4-1201-jdbc41"]]
  :resources-paths ["resources/ojdbc6.jar"])
  </code></pre>
  
  <p>I added ojdbc.jar manually to resources folder I created in my project folder.</p>
  
  <p>Here are details of my connection:</p>
  
  <pre><code>(def db {:classname "oracle.jdbc.OracleDriver"
       :subprotocol "oracle"
       :subname "//localhost:1521/my_database"
       :user "user"
       :password "password"})
  </code></pre>
  
  <p>and my function with query:</p>
  
  <pre><code>(defn get-all []
   (sql/query db ["select * from my_table"]))
  </code></pre>
  
  <p>When I call this function I get this error: Caused by java.sql.SQLException
     No suitable driver found for jdbc:oracle://localhost:1521/my_database</p>
  
  <pre><code>        DriverManager.java:  689  java.sql.DriverManager/getConnection
          DriverManager.java:  208  java.sql.DriverManager/getConnection
                    jdbc.clj:  255  clojure.java.jdbc/get-connection
                    jdbc.clj:  176  clojure.java.jdbc/get-connection
                    jdbc.clj:  832  clojure.java.jdbc/db-query-with-resultset
                    jdbc.clj:  790  clojure.java.jdbc/db-query-with-resultset
                    jdbc.clj:  866  clojure.java.jdbc/query
                    jdbc.clj:  838  clojure.java.jdbc/query
                 RestFn.java:  425  clojure.lang.RestFn/invoke
                    core.clj:   12  db-examples.core/get-all
                    core.clj:   11  db-examples.core/get-all
                    core.clj:   14  db-examples.core/eval4272
  </code></pre>