db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Rasmussen <jrasmus...@lnxi.com>
Subject RE: Accessing multiple databases from One Torque Application
Date Wed, 10 Dec 2003 22:38:15 GMT
Thanks Ramesh. 

Just have a few questions about how you did this.

Did you generate the Torque code for both databases together(Using one
build.properties file)?

Does Torque handle the objects the same way for the second DB?
(Does calling the .save() method on the database objects save to the
correct database? I don't understand what you use the
Torque.getConnection("seconddb") line for.)


Thanks again for your support and the support of the list.

Jeff Rasmussen

On Wed, 2003-12-03 at 11:09, Ramesh Sabeti wrote:
> This is how I'm doing it:
> 
> Create another set of entries for your second connection in
> torque.properties. The first one can remain as the default connection
> and the second one would be a named connection.  So if the first one is:
> 
> torque.database.default=default
> torque.database.default.adapter=oracle
> 
> torque.dsfactory.default.connection.driver =
> oracle.jdbc.driver.OracleDriver
> ... followed by the rest of the setup
> 
> The second one is setup as:
> torque.dsfactory.seconddb.factory=org.apache.torque.dsfactory.TorqueData
> SourceFactory
> torque.dsfactory.seconddb.pool.defaultMaxConnections=10
> ... followed by the rest of the setup
> 
> In your app, you can get a connection to the second db as follows:
> Torque.getConnection("seconddb")
> 
> Hope it helps,
> 
> Ramesh.
> 
> 
> > -----Original Message-----
> > From: Jeff Rasmussen [mailto:jrasmussen@lnxi.com]
> > Sent: Wednesday, December 03, 2003 9:21 AM
> > To: 'Apache Torque Users List'
> > Subject: Accessing multiple databases from One Torque Application
> > 
> > 	I have the need to access a mysql database and a odbc database
> from
> > the
> > same web application,  I have successfully been running the torque
> with
> > the mysql db and would like to use torque for both connections. I have
> > referenced the documentation and have not seen anything addressing
> this
> > issue. Any past experience or links to documentation(If I missed it
> > somewhere) would be greatly appreciated.
> > 
> > 	I also could use some in-site on using the JDBC-ODBC bridge
> driver.
> > I
> > read on sun's website that this driver should only be used as a last
> > resort. Does anyone know of a better way to connect to proprietary
> DB's
> > through ODBC?
> > 
> > Many Thanks,
> > 
> > Jeff Rasmussen
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message