db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caron, Roger A." <roger.ca...@pw.utc.com>
Subject RE: Multiple databases without JNDI ?
Date Tue, 27 Apr 2004 16:50:57 GMT
Both should actually work.

1) object.save() will use the default Torque Connection
2) object.save(java.sql.Connection con) will use a separate connection which
you must create prior
3) object.save(java.lang.String dbName) will save to the DB specified.
You'll probably want to use 
	object.save(objectPeer.DATABASE_NAME) if a separate database_name
was specified in your xml used to 
	create the om classes and the same database_name has connection
parameters in your Torque.properties.

I've never used option #3 but I'm assuming you'll need the connection
parameters specified in your Torque.properties if you want torque to create
a connection and perform the save to a DB other than the default.

Roger


-----Original Message-----
From: Saravana Kannan [mailto:skkann0@engr.uky.edu]
Sent: Tuesday, April 27, 2004 12:34 PM
To: Apache Torque Users List; jrasmussen@lnxi.com
Subject: RE: Multiple databases without JNDI ?


Hi.

 I don't remember exactly what to use... but I know 
that you should use a object.save(connection) or 
object.save("database name"). It's either one of these.
... check out the Torque API page. Google it if u cant 
find it.

~Sarav

-- 
There are 10 kinds of people in the world,
those who know binary and those who don't.


Quoting Jeff Rasmussen <jrasmussen@lnxi.com>:

> How do you access the different DB's with this method?
> 
> Do you just init torque and call object.save()?
> 
> Is there anything special that needs to be done or does Torque
> automatically know what DB to save to?
> 
> Thanks, 
> Jeff Rasmussen
> 
> 
> 
> 
> On Wed, 2004-03-17 at 11:14, Benjamin Yu wrote:
> > Yes, it is possible. Just enter multiple dsfactory entries into the
> > *runtime* Torque.properties file.
> > 
> > Something like:
> > 
> > torque.database.default=db1
> > 
> > torque.database.db1.adapter=postgresql
> >
>
torque.dsfactory.db1.factory=org.apache.torque.dsfactory.SharedPoolDataSourc
> > eFactory
> > torque.dsfactory.db1.pool.maxActive=10
> > torque.dsfactory.db1.pool.testOnBorrow=true
> > torque.dsfactory.db1.pool.validationQuery=SELECT 1
> > torque.dsfactory.db1.connection.driver=org.postgresql.Driver
> > torque.dsfactory.db1.connection.url=jdbc:postgresql://localhost/db2
> > torque.dsfactory.db1.connection.user=user1
> > torque.dsfactory.db1.connection.password=pw1
> > 
> > torque.database.db2.adapter=postgresql
> >
>
torque.dsfactory.db2.factory=org.apache.torque.dsfactory.SharedPoolDataSourc
> > eFactory
> > torque.dsfactory.db2.pool.maxActive=10
> > torque.dsfactory.db2.pool.testOnBorrow=true
> > torque.dsfactory.db2.pool.validationQuery=SELECT 1
> > torque.dsfactory.db2.connection.driver=org.postgresql.Driver
> > torque.dsfactory.db2.connection.url=jdbc:postgresql://localhost/db1
> > torque.dsfactory.db2.connection.user=user2
> > torque.dsfactory.db2.connection.password=pw2
> > 
> > 
> > -----Original Message-----
> > From: Bogdan Vatkov [mailto:bvatkov@globaltech-bg.com]
> > Sent: Wednesday, March 17, 2004 10:10 AM
> > To: TORQUE_LIST
> > Subject: Multiple databases without JNDI ?
> > 
> > 
> > Hi guys,
> > Is it possible to configure multiple databases without using JNDI ?
> > If yes how the build.properties will look like ?
> > 
> > regards,
> > bogdan
> > 
> > ---------------------------------------------------------------------
> > 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

---------------------------------------------------------------------
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