Re: Casting java arguments...

2008-10-16 Thread Luc Prefontaine
Ouf ! I'm not insane, (at least regarding this bug :))) I just realized that when I explicitly register the driver, there are now two instances begin added: Clojure user= (println (enumeration-seq (. java.sql.DriverManager getDrivers))) ([EMAIL PROTECTED]) ;; No instance registered nil user=

Re: Casting java arguments...

2008-10-16 Thread Achim Passen
Hi, Am 17.10.2008 um 03:12 schrieb Luc Prefontaine: This means that (clojure.lang.RT/classForName com.mysql.jdbc.Driver) has no effect on the static code in the class. You're right, RT/classForName doesn't do initialization. Does this work for you?: (Class/forName

Re: Casting java arguments...

2008-10-16 Thread Luc Prefontaine
Yep, Class/forName does the job. I like the consistency of the JVM implementations (glup !), I run on Ubuntu wih: java version 1.6.0_03 Java(TM) SE Runtime Environment (build 1.6.0_03-b05) Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode) I do have the mysql jar file in my classpath

Re: Casting java arguments...

2008-10-16 Thread Stephen C. Gilardi
On Oct 16, 2008, at 11:18 PM, Luc Prefontaine wrote: Looking at classForName in the RT.java module (in trunk, checked out a few days ago): static public Class classForName(String name) throws ClassNotFoundException{ return Class.forName(name, false, baseLoader()); } false

Re: Casting java arguments...

2008-10-14 Thread Luc Prefontaine
The SQL library in clojure-contrib already does this just for that sole purpose: (defmacro with-connection Evaluates body in the context of a new connection to a database then closes it. db-spec is a map containing string values for these required keys: :classname the jdbc driver

Re: Casting java arguments...

2008-10-12 Thread Timothy Pratley
Rich, I may be old school (surely just because of my age) but would it be possible some day to create a cook book in PDF ? FYI Hans uploaded a manual.pdf to the files section of this group, which is great. Thanks Hans. Very useful. See original post

Re: Casting java arguments...

2008-10-10 Thread Michael Wood
On Fri, Oct 10, 2008 at 11:45 AM, mritun [EMAIL PROTECTED] wrote: On Oct 10, 1:46 am, Luc Prefontaine [EMAIL PROTECTED] wrote: [...] The mysql jdbc driver code says that it registers itself (static block) but something is wrong. Eventually I will find why but now I have other pressing needs

Re: Casting java arguments...

2008-10-09 Thread J. McConnell
On Thu, Oct 9, 2008 at 12:06 PM, Luc Prefontaine [EMAIL PROTECTED] wrote: I may look stupid but how do you cast Java arguments ? user= (doc cast) - clojure/cast ([c x]) Throws a ClassCastException if x is not a c, else returns x. nil So, (cast java.sql.Driver

Re: Casting java arguments...

2008-10-09 Thread Stephen C. Gilardi
On Oct 9, 2008, at 12:06 PM, Luc Prefontaine wrote: Hi everyone, I may look stupid but how do you cast Java arguments ? (java.sql.DriverManager/registerDriver (clojure.lang.RT/classForName com.mysql.jdbc.Driver)) java.lang.ClassCastException: java.lang.Class cannot be cast to