On 27/06/2016 17:44, Jerry Malcolm wrote: > I'm assuming that context.lookup(...) simply locates the "jdbc/myDB" > <Resource> tag in the context.xml file, pulls all of the parms out of > that tag, creates a DataSource object utilizing the parms, and returns > it. If that's the case, couldn't I create a variation/subclass of the > Context object that modifies the url parm that it found in the resource > tag and puts the desired db name into the url before constructing the > DataSource?
Sure. You need to implement the appropriate factory and then specify your factory class explicitly in the Resource element using the factory attribute. You probably want to start here for ideas on how to code up your factory: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/ or for a more specific example: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSourceFactory.java?view=annotate Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org