db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Support multiple Derby systems in one VM
Date Wed, 23 Nov 2005 23:17:18 GMT
David W. Van Couvering wrote:

> I also wanted to share an idea to help move us towards the larger
> problem supporting multiple Derby systems within the same VM (currently
> that's not possible).

> DataSource dsA = systemA.getDataSource("jdbc:derby:wombat;create=true");
> DataSource dsB = systemB.getDataSource("jdbc:derby:wombat;create=true");
> 
> Connection connA = dsA.getConnection();
> Connection connB = dsB.getConnection();

Has some potential, I do think we need to be careful about going in
directions that are not in line with existing ways to load JDBC drivers.
For example your code is mixing JDBC URLs with DataSource, that's not
expected JDBC programming. If the getDataSource() method just returned a
DataSource object, then this would be closer to expected JDBC programming.

DataSource dsA = systemA.getDataSource();
DataSource dsB = systemB.getDataSource();

// set JavaBean properties on dsA and dsB

However, it does seem to me that JDBC already provides two factory
classes for getting connections, Driver and DataSource. Do we really
need another factory api?

Dan.


Mime
View raw message