Mantis - Resin
Viewing Issue Advanced Details
1932 minor always 08-07-07 08:56 11-05-07 14:55
ferg  
ferg  
normal  
closed  
fixed  
none    
none 3.1.4  
0001932: DataSource casting
(rep by Geoff Hendry)


I've got an interesting database pooling need. I have multiple databases, each with a different URL which is determined dynamically at runtime. Therefore, I cannot provide these URL (or associated database info) at configuration time.

I need to be able to dynamically instruct Derby's DataSource to provide a connection to a particular database, with particular parameters.

On Jetty web server, I cast the DataSource to a org.apache.derby.jdbc.ClientConnectionPoolDataSource and I can then call methods on that class to point it at the right database.

However, on resin, the DataSource returned to me is the DBPool. What I need is some way to get at the underlying ClientConnectionPoolDataSource and call methods on it. I was looking at the JDK 6/JDBC 4 Wrapper class as a possible way to get at the underlying DataSource implementation, but I don't kow if that's the rght aproach, or if Resin even supports it.

If I use a standard non-pooled org.apache.derby.jdbc.ClientDataSource then I don't have this problem since Resin just returns the ClientDataSource as expected. But then I don't get pooling, which I need. Please advise.

Notes
(0002444)
ferg   
11-05-07 14:55   
server/4504