Hi, in my case, I have two connection descriptors:
<jdbc-connection-descriptor jcd-alias="default" default-connection="true" ... and <jdbc-connection-descriptor jcd-alias="remote" default-connection="false" ... Using localbroker = PersistenceBrokerFactory.defaultPersistenceBroker(); remotebroker = PersistenceBrokerFactory.createPersistenceBroker(new PBKey("remote")); I can access both data bases. Best regards Bernd -----Ursprüngliche Nachricht----- Von: henrydav [mailto:henry...@indiana.edu] Gesendet: Donnerstag, 2. April 2009 17:33 An: ojb-user@db.apache.org Betreff: Re: AW: Adding a second data source. Okay, both responses verify what I thought was true, so thank you for that. I've tried the approach you mentioned below (PersistenceBrokerFactory.createPersistenceBroker(new PBKey("myJcdAlias"))), as well as the Spring approach (since this project also mixes Spring 1.2 in): setJcdAlias("myJcdAlias"); getPersistenceBrokerTemplate(); In both cases, my dataSource is null, which leads me to believe my jcd-alias isn't mapped up properly in the jdbc-connection-descriptor. I guess what I don't understand is how the jcd-alias value is resolved. To what does this attribute directly refer or map? Thanks for your help, Bernd and Andrei. Bernd Längerich wrote: > > Hi, > > You can leave your existing connection as default and add a second (named) > connection. You have to specify where to use the second connection by > using an appropriate method (i.e. for the PB-API > PersistenceBrokerFactory.createPersistenceBroker(new PBKey(jcdalias)) vs. > PersistenceBrokerFactory.defaultPersistenceBroker()). > > Best regards > Bernd > > -----Ursprüngliche Nachricht----- > Von: henrydav [mailto:henry...@indiana.edu] > Gesendet: Donnerstag, 2. April 2009 16:38 > An: ojb-user@db.apache.org > Betreff: Adding a second data source. > > > I'm currently working with a project that uses a single data source, using > default-connection=true in the jdbc-connection-descriptor. I now need to > add > a second data source, but can I leave the first data source as a > default-connection, or do I need to change it and configure the connection > programmatically? I'm fairly new to this and I've been reading OJB > documentation the past couple of days, but I apologize if I'm leaving out > requisite information. > -- > View this message in context: > http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22849428.html > Sent from the Apache DB - ObjectRelationalBridge Users mailing list > archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-user-unsubscr...@db.apache.org > For additional commands, e-mail: ojb-user-h...@db.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-user-unsubscr...@db.apache.org > For additional commands, e-mail: ojb-user-h...@db.apache.org > > > -- View this message in context: http://www.nabble.com/Adding-a-second-data-source.-tp22849428p22850281.html Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-user-unsubscr...@db.apache.org For additional commands, e-mail: ojb-user-h...@db.apache.org