Re: Driver+ClassLoader issue

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Apr 10 2008 - 11:03:48 EDT

  • Next message: John Emmanuel: "Runtime Relationships in Cayenne Modeler"

    Scott,

    I started looking at CAY-1024 patch, and came to a conclusion that
    there is a simpler and more consistent solution. Instead of Cayenne
    failing over to DriverManager in 'setDriverClassName' (which arguably
    can return a driver with a different class name that does not match
    the method argument, hence creating confusion), can you simply set the
    driver class name to NULL. 'getConnection' method then will consult
    DriverManager and return the driver you specified.

    Could you check that it works for you?

    Thanks
    Andrus

    On Apr 4, 2008, at 7:58 PM, Scott Anderson wrote:

    > I am using a special wrapper around my Driver so that I don't need to
    > have the jar on the classpath. This trick clashes with the
    > DriverDataSource class. Instead of failing immediately if the class
    > doesn't exist, it might be prudent to check with the
    > java.sql.DriverManager first - or, heck, even go there first - after
    > all, that is the standard way of obtaining a Driver.
    >
    >
    >
    > Regards,
    >
    > Scott
    >



    This archive was generated by hypermail 2.0.0 : Thu Apr 10 2008 - 11:04:21 EDT