db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramesh Sabeti" ...@reazon.com>
Subject RE: Accessing multiple databases from One Torque Application
Date Wed, 03 Dec 2003 18:09:59 GMT
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


Mime
View raw message