tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55662] New: Add a way to set an instance of java.sql.Driver directly on org.apache.tomcat.jdbc.pool.DataSource
Date Thu, 17 Oct 2013 13:29:20 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55662

            Bug ID: 55662
           Summary: Add a way to set an instance of java.sql.Driver
                    directly on org.apache.tomcat.jdbc.pool.DataSource
           Product: Tomcat 7
           Version: 7.0.42
          Hardware: Macintosh
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Integration
          Assignee: dev@tomcat.apache.org
          Reporter: nebhale@nebhale.com

Currently when org.apache.tomcat.jdbc.pool.DataSource is directly instantiated
(e.g. in an IoC environment), the only way to set the type of java.sql.Driver
that is should use is by passing in a String classname which is then passed to
DriverManager.  The downside to this is that it requires the DataSource and the
Driver to be in the same classloader.  In practice many times the Driver is in
the application classloader while the DataSource is in the container
classloader meaning that other than packaging a Tomcat JAR in your application
you cannot use the DataSource directly.

It'd be great to have a way to pass the actual instance of Driver to the
DataSource and have it use that instead of going to DriverManager to find it. 
This would enable standard classloader inheritance to work properly and allow
the non-adjacent packaging of the Driver and DataSource.

An example of this style of configuration can be found in Spring's
SimpleDriverDataSource[1].

[1]:
http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/jdbc/datasource/SimpleDriverDataSource.html#setDriver(java.sql.Driver)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message