I'm trying to use the sql contrib with Microsoft SQL Server Express 2005.

1. I've included sqljdbc.jar in my classpath.

2. In my namespace I (:require [clojure.contrib.sql :as sql])

3. I'm defining my database connection as follows:

(def db {:classname "com.microsoft.sqlserver.jdbc.SQLServerDriver"
      :subprotocol "sqlserver"
      :subname "//sqlserver\\sqlexpress" ; this is hostname and instance
name. I've tried just //sqlserver and sqlserver also
      :user "username"
      :password "password"
      })

 4. But when I try to access the database:
(sql/with-connection db
  (sql/with-results res
    "select * from exercises"
    (doseq rec res
      (println rec))))

5. I get the following error:
No suitable driver found for jdbc:sqlserver://sqlserver\sqlexpress
  [Thrown class java.sql.SQLException]

Restarts:
 0: [ABORT] Return to SLIME's top level.

Backtrace:
  0: java.sql.DriverManager.getConnection(Unknown Source)
  1: java.sql.DriverManager.getConnection(Unknown Source)

Can anyone help?

Thanks!
Scott

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to