> 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

Reply via email to