Thank you Scott... This was very helpful.

Perhaps this is obvious, but I had a little snag with these instructions and I
wanted the list to see what I did to make it work.

First, I should have said I am working on the daily build from 6/18.. not the
released build.  I suspect there are difference in how Torque is packaged and
where properties go.

1)  I am sure this is just a typo...
database.adaptor=DBDOracle
database.adaptor.DBDOracle={Oracle JDBC Driver}

should be:
database.adaptor=DBOracle
database.adaptor.DBOracle={Oracle JDBC Driver}

2) In TurbineResources.properties put
database.adaptor=DBOracle
database.adaptor.DBOracle={Oracle JDBC Driver}

3) in Torque.properties put  ( NOTE:  I ORIGINALLY THOUGHT THIS SHOULD GO IN
TurbineResources.properties but I was wrong )
database.db2.driver={oracle driver}
database.db2.url={oracle url}
database.db2.username=db2
database.db2.password=db2

After I did that code like:
java.sql.Connection conn1 = TurbineDB.getConnection("db2").getConnection();

worked.

Thanks again Scott

Pat




"Weaver, Scott" wrote:

> > You can access in that way only the Turbine DB, i. e. the
> > Databse where your
> > jetspeed user information etc. is saved. This database is defined in
> > turbineproperties.resources.
> > If you want to access a "third" database, you need to do it manually.
>
> Again, this is an incorrect statement.  I apologize if my first email was to
> brief to make this clear.  I will try to explain with more in depth with the
> examples below.
>
> You can set up TurbineResources so that Turbine (Jetspeed) supports multiple
> db pools.  I know this works because I have used it in the past to connect
> to both a MySQL DB and a AS400/DB2 DB at the same time.
>
> Example TR.props...
>
> database.db1.driver=org.gjt.mm.mysql.Driver
> database.db1.url=jdbc:mysql://localhost/db1
> database.db1.username=db1
> database.db1.password=db1
>
> database.db2.driver=org.gjt.mm.mysql.Driver
> database.db2.url=jdbc:mysql://localhost/db2
> database.db2.username=db2
> database.db2.password=db2
>
> database.db3.driver=com.ibm.as400.access.AS400JDBCDriver
> database.db3.url=jdbc:as400://10.1.1.1/db3
> database.db3.username=db3
> database.db3.password=db3
>
> You must also make sure that you have DB adapters defined for each seperate
> TYPE of database.  For this configuration you would have these entries in
> TurbineResources:
> # Supports the 2 MySQL DBs
> database.adaptor=DBMM
> database.adaptor.DBMM=org.gjt.mm.mysql.Driver
> # Supports the 1 AS400 DB
> database.adaptor=DBDB2400
> database.adaptor.DBDB2400=com.ibm.as400.access.AS400JDBCDriver
>
> If you are using Oracle, use the correct Oracle JDBC driver and add an entry
> like this:
> database.adaptor=DBDOracle
> database.adaptor.DBDOracle={Oracle JDBC Driver}
>
> Then in your code...
>
> //For a connection from db1
> java.sql.Connection conn1 = TurbineDB.getConnection("db1").getConnection();
>
> //For a connection from db2
> java.sql.Connection conn2 = TurbineDB.getConnection("db2").getConnection();
>
> //For a connection from db3
> java.sql.Connection conn3 = TurbineDB.getConnection("db3").getConnection();
>
> Scott


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

Reply via email to