ah, right, got it. thanks. One more question though:

Would it be possible to get torque to somehow create an object model for
more than one database by somehow configuring the appropriate schema file?

If I define multiple schema files it seems to generate all the schema files
in one database only. How can I tell it to create different schemas inside
different databases?

Also, if the above is possible, would it be necessary to explicitly tell
torque which database to use when making use of the object model?

Ilan





> -----Original Message-----
> From: David Demner [mailto:[EMAIL PROTECTED]
> Sent: 19 May 2004 04:36
> To: 'Turbine Users List'
> Subject: RE: Multiple DB connections
>
>
> Sorry for not being clearer.  Then all you would do is in your java is:
>
> java.sql.Connection connNewapp = Torque.getConnection("newapp");
> (or connNewapp = Torque.getConnection() since newapp is the default
> connection)
> java.sql.Connection connNewapp2 = Torque.getConnection("newapp2");
> java.sql.Connection connNewapp3 = Torque.getConnection("newapp3");
>
> This will get a standard java.sql.Connection to the databases
> configured in
> your Torque.properties (for your one application) even though they are
> pointing to 3 different databases.
>
> David
>
> -----Original Message-----
> From: Ilan Azbel [mailto:[EMAIL PROTECTED]
> Sent: Wednesday May 19, 2004 1:26 AM
> To: Turbine Users List
> Subject: RE: Multiple DB connections
>
>
> I see that you have configured 3 different application?!?! Can all three
> connections be used from one application?
>
> How would I get ant to generate the class files necessary for
> accessing the
> three different database from one application?
>
>
>
> > -----Original Message-----
> > From: David Demner [mailto:[EMAIL PROTECTED]
> > Sent: 18 May 2004 05:37
> > To: 'Turbine Users List'
> > Subject: RE: Multiple DB connections
> >
> >
> > How are you connecting to the databases?  For the default from
> the tdk it
> > would be (in Torque.properties):
> >
> > torque.database.default=newapp
> > torque.database.newapp.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp.factory=org.apache.torque.dsfactory.Torque
> > DataSource
> > Factory
> > torque.dsfactory.newapp.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp.connection.url = jdbc:mysql://host1/newapp
> > torque.dsfactory.newapp.connection.user = root1
> > torque.dsfactory.newapp.connection.password = root1
> >
> > torque.database.newapp2=newapp2
> > torque.database.newapp.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp2.factory=org.apache.torque.dsfactory.Torqu
> > eDataSourc
> > eFactory
> > torque.dsfactory.newapp2.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp2.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp2.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp2.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp2.connection.url = jdbc:mysql://host2/newapp
> > torque.dsfactory.newapp2.connection.user = root2
> > torque.dsfactory.newapp2.connection.password = root2
> >
> > torque.database.newapp3=newapp3
> > torque.database.newapp3.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp3.factory=org.apache.torque.dsfactory.Torqu
> > eDataSourc
> > eFactory
> > torque.dsfactory.newapp3.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp3.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp3.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp3.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp3.connection.url = jdbc:mysql://host3/newapp
> > torque.dsfactory.newapp3.connection.user = root3
> > torque.dsfactory.newapp3.connection.password = root3
> >
> >
> > Of course this changes depending on your choice of connection method.
> >
> > Good luck,
> >
> > David
> >
> > -----Original Message-----
> > From: Ilan Azbel [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday May 18, 2004 6:58 AM
> > To: Turbine Users List
> > Subject: Multiple DB connections
> >
> >
> > Hello,
> >
> > I have a requirement that my web app connects to 3 different
> > databases, all
> > residing on different servers. How can this be achieved?
> >
> > Ilan
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to