Liking cljdoc? Tell your friends :D

clj-dbcp.core

Create DataSource using Apache DBCP

Create DataSource using Apache DBCP
raw docstring

default-subproto-mapclj

source

jdbc-datasourceclj

(jdbc-datasource
  {:keys [classname jdbc-url properties user username password test-query
          init-size min-idle max-idle max-total pool-pstmt? max-open-pstmt
          remove-abandoned? remove-abandoned-timeout-seconds log-abandoned?
          remove-abandoned-on-borrow? remove-abandoned-on-maintenance?
          lifo-pool? test-while-idle? test-on-borrow? test-on-return?
          test-query-timeout millis-between-eviction-runs min-evictable-millis
          tests-per-eviction cache-state?]
   :or {max-idle 1
        log-abandoned? true
        min-idle 1
        test-on-return? true
        cache-state? true
        millis-between-eviction-runs -1
        init-size 1
        tests-per-eviction 3
        test-on-borrow? true
        lifo-pool false
        test-while-idle? true
        max-total 2
        min-evictable-millis 1800000
        remove-abandoned-timeout-seconds 60
        remove-abandoned? true
        pool-pstmt? true}
   :as opts})

Create DataSource from a given option map

Create DataSource from a given option map
sourceraw docstring

jndi-datasourceclj

(jndi-datasource resource-ref-name)
(jndi-datasource init-ctx resource-ref-name)

Lookup JNDI DataSource. Example Tomcat 6 configuration (/WEB-INF/web.xml): <resource-ref> <description> Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the <Context> configurartion for the web application. </description> <res-ref-name> jdbc/EmployeeDB </res-ref-name> <res-type> javax.sql.DataSource </res-type> <res-auth> Container </res-auth> </resource-ref> You can fetch this datasource as follows: (jndi-datasource "java:comp/env/jdbc/EmployeeDB")

Lookup JNDI DataSource. Example Tomcat 6 configuration (/WEB-INF/web.xml):
<resource-ref>
  <description>
    Resource reference to a factory for java.sql.Connection
    instances that may be used for talking to a particular
    database that is configured in the <Context>
    configurartion for the web application.
  </description>
  <res-ref-name>
    jdbc/EmployeeDB
  </res-ref-name>
  <res-type>
    javax.sql.DataSource
  </res-type>
  <res-auth>
    Container
  </res-auth>
</resource-ref>
You can fetch this datasource as follows:
  (jndi-datasource "java:comp/env/jdbc/EmployeeDB")
sourceraw docstring

lite-datasourceclj

(lite-datasource {:keys [classname jdbc-url]})

Create lite datasource that ignores setAutoCommit calls.

Create lite datasource that ignores setAutoCommit calls.
sourceraw docstring

make-datasourceclj

(make-datasource opts)
(make-datasource adapter opts)

Create datasource from a given option-map. Some examples are below: (make-datasource :jdbc {:jdbc-url "jdbc:mysql://localhost/emp" :class-name "com.mysql.Driver"}) ;; JDBC arguments (make-datasource :odbc {:dsn :sales_report}) ;; ODBC connections (make-datasource :jndi {:context "whatever"}) ;; JNDI connections (make-datasource {:adapter :odbc-lite :dsn :moo}) ;; ODBC-lite (MS-Access, MS-Excel etc.) (make-datasource {:class-name 'com.mysql.Driver :jdbc-url "jdbc:mysql://localhost/emp"}) ;; JDBC is default adapter

Create datasource from a given option-map. Some examples are below:
(make-datasource :jdbc  {:jdbc-url   "jdbc:mysql://localhost/emp"
                         :class-name "com.mysql.Driver"})          ;; JDBC arguments
(make-datasource :odbc  {:dsn :sales_report})                        ;; ODBC connections
(make-datasource :jndi  {:context "whatever"})                     ;; JNDI connections
(make-datasource {:adapter :odbc-lite :dsn :moo})                    ;; ODBC-lite (MS-Access, MS-Excel etc.)
(make-datasource {:class-name 'com.mysql.Driver
                  :jdbc-url   "jdbc:mysql://localhost/emp"})       ;; JDBC is default adapter
sourceraw docstring

parse-urlclj

(parse-url jdbc-uri)
(parse-url jdbc-uri subproto-map)

Given a String or a URI instance, and an optional subproto-map for conversion return a map of args suitable for use with make-datasouce.

Given a String or a URI instance, and an optional subproto-map for conversion
return a map of args suitable for use with `make-datasouce`.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close