> The following fails:
>
> user=>  (cast java.sql.Driver (clojure.lang.RT/classForName
> "com.mysql.jdbc.Driver"))
> java.lang.ClassCastException (NO_SOURCE_FILE:0)
>
> The com.mysql.jdbc.Drive does implement the java.sql.Driver interface:
>
> user=> (bases  (clojure.lang.RT/classForName "com.mysql.jdbc.Driver"))
> (com.mysql.jdbc.NonRegisteringDriver java.sql.Driver)
>
> Is my syntax right ?

Your syntax is right, but you aren't casting the right thing here.
(clojure.lang.RT/classForName "com.mysql.jdbc.Driver") does not return
a com.mysql.jdbc.Driver, it returns a Class<com.mysql.jdbc.Driver>.
I.e., it is an instance of Class, not of java.sql.Driver.

As for how to get something valid to pass into registerDriver, I don't
know off-hand. You need to get a valid instance of
com.mysql.jdbc.Driver. You'll have to check the docs for that Driver,
I guess.

HTH,

- J.

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to