You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Albrecht F.Leiprecht" <al...@mail.ccc-casino.com> on 2001/03/22 16:58:22 UTC

More than one database.adaptor ?

Is it possible to have more than one Database adaptors like :

database.adaptor=DBMM, DBAD
database.adaptor.DBMM=org.gjt.mm.mysql.Driver
database.adaptor.DBAD=de.sag.jdbc.adabasd.ADriver

can I use both databases then ?  

rgds
albi


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: More than one database.adaptor ?

Posted by Pere Torrodellas <pt...@fihoca.com>.
----- Mensaje original -----
De: Albrecht F.Leiprecht <al...@mail.ccc-casino.com>
Para: <tu...@jakarta.apache.org>
Enviado: viernes 23 de marzo de 2001 16:23
Asunto: Re: More than one database.adaptor ?
> ...........................
> Do you also have experience about performance issues with more than 1
DBs ??

We have not worried about performance yet, but since every DB adaptor
has its own objects, drivers and connection pool, I think the issue is
only storage to hold them all.

Pere Torrodellas




---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: More than one database.adaptor ?

Posted by "Albrecht F.Leiprecht" <al...@mail.ccc-casino.com>.
> Hi,
>
> If I interpret correctly your question... yes, whe are doing it in our
> test project: some data is in Oracle and some is in DB2. Our
> TR.properties is the following:
>
> database.default.driver=oracle.jdbc.driver.OracleDriver
> database.default.url=jdbc:oracle:thin:@srvlabbcn:1521:LABO
> database.default.username=myuser
> database.default.password=mypw
>[...]
> database.adaptor=DBOracle
> database.adaptor.DBOracle=oracle.jdbc.driver.OracleDriver
>
> database.adaptor=DBDB2Net
> database.adaptor.DBDB2Net=COM.ibm.db2.jdbc.net.DB2Driver
>

Yes I think this answers most of my question....

I tried what John was refering to :

    project-schema.xml
    <database name="db1">
    ...
    <database name="db2">
    ....

according to the database.dtd this is valid...

then I tried to create the om files (both dbs on the same dbserver) to
see how it is determined which driver it will use.

It didnt work...

but it seems that the <tablename>MapBuilder.class does the selection
in the doBuild Method (is that correct?)

        dbMap = TurbineDB.getDatabaseMap("mySecondDB");

I will have to find where to apply the following Information, but it's
very valueable for me thank you very much ...

> The connection info for DB2 (driver, url, user, pw) is provided
> dynamically when we register the DB2 pool:
>
> TurbineDB.registerPool(db2Pool, sqlDriver, urlDB, user, password);
>
> but I think that it could as well be specifyed in TR.properties.
> Then:
>
> dbCon = TurbineDB.getConnection();  /* default pool, i.e. Oracle */
> or
> dbCon = TurbineDB.getConnection(db2Pool);  /* DB2 pool */

Do you also have experience about performance issues with more than 1 DBs ??

kind regards
albi


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: More than one database.adaptor ?

Posted by Pere Torrodellas <pt...@fihoca.com>.
Hi,

If I interpret correctly your question... yes, whe are doing it in our
test project: some data is in Oracle and some is in DB2. Our
TR.properties is the following:

database.default.driver=oracle.jdbc.driver.OracleDriver
database.default.url=jdbc:oracle:thin:@srvlabbcn:1521:LABO
database.default.username=myuser
database.default.password=mypw

........................

database.adaptor=DBOracle
database.adaptor.DBOracle=oracle.jdbc.driver.OracleDriver

database.adaptor=DBDB2Net
database.adaptor.DBDB2Net=COM.ibm.db2.jdbc.net.DB2Driver

The connection info for DB2 (driver, url, user, pw) is provided
dynamically when we register the DB2 pool:

TurbineDB.registerPool(db2Pool, sqlDriver, urlDB, user, password);

but I think that it could as well be specifyed in TR.properties.
Then:

dbCon = TurbineDB.getConnection();  /* default pool, i.e. Oracle */
or
dbCon = TurbineDB.getConnection(db2Pool);  /* DB2 pool */

Hope this helps.

Pere Torrodellas

----- Mensaje original -----
De: Albrecht F.Leiprecht <al...@mail.ccc-casino.com>
Para: <tu...@jakarta.apache.org>
Enviado: jueves 22 de marzo de 2001 16:58
Asunto: More than one database.adaptor ?


> Is it possible to have more than one Database adaptors like :
>
> database.adaptor=DBMM, DBAD
> database.adaptor.DBMM=org.gjt.mm.mysql.Driver
> database.adaptor.DBAD=de.sag.jdbc.adabasd.ADriver
>
> can I use both databases then ?
>
> rgds
> albi
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: More than one database.adaptor ?

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Albrecht F.Leiprecht" <al...@mail.ccc-casino.com> writes:

> > There is a description on the site:
> >
> > http://jakarta.apache.org/turbine/db-adapters.html
> 
> It says that you have to extend
>     org.apache.turbine.db.adapter.DB
> I think it should be
>     org.apache.turbine.util.db.adapter.DB

Fixed, thanks.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: More than one database.adaptor ?

Posted by "Albrecht F.Leiprecht" <al...@mail.ccc-casino.com>.
> There is a description on the site:
>
> http://jakarta.apache.org/turbine/db-adapters.html
>
> I followed it ...

I found a difference between the document I refered to and
the situation in the tdk (in think its tdk11a11)

It says that you have to extend
    org.apache.turbine.db.adapter.DB
I think it should be
    org.apache.turbine.util.db.adapter.DB

Meanwhile I'm using the same code used in DBSybase. (for testpurposes)
That is actually a good example for the above mentioned document
(db-adapters.html)

rgds
albi



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: More than one database.adaptor ?

Posted by "Albrecht F.Leiprecht" <al...@mail.ccc-casino.com>.
----- Original Message ----- 
From: Albrecht F.Leiprecht <al...@mail.ccc-casino.com>
To: <tu...@jakarta.apache.org>
Sent: Thursday, March 22, 2001 11:58 AM
Subject: More than one database.adaptor ?


> Is it possible to have more than one Database adaptors like :
> 
> database.adaptor=DBMM, DBAD
> database.adaptor.DBMM=org.gjt.mm.mysql.Driver
> database.adaptor.DBAD=de.sag.jdbc.adabasd.ADriver
> 
> can I use both databases then ?  

There is a description on the site:

http://jakarta.apache.org/turbine/db-adapters.html

I followed it ...

rgds
albi


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: More than one database.adaptor ?

Posted by John McNally <jm...@collab.net>.
It has always been possible to list all the database adaptors in
TR.props (unless this recently changed.)

Using multiple db's is possible as well.  You just need to give them
names in the schema that match the names used in setting connection
properties in TR.props.

TR.props
database.db1.driver=org.gjt.mm.mysql.Driver
...
database.db2.driver=org.postgresql.xxxxxx.Driver
...

project-schema.xml
<database name="db1">
...
<database name="db2">
....

Daniel Rall wrote:
> 
> Jason van Zyl <jv...@apache.org> writes:
> 
> > "Albrecht F.Leiprecht" wrote:
> > >
> > > Is it possible to have more than one Database adaptors like :
> > >
> > > database.adaptor=DBMM, DBAD
> > > database.adaptor.DBMM=org.gjt.mm.mysql.Driver
> > > database.adaptor.DBAD=de.sag.jdbc.adabasd.ADriver
> > >
> > > can I use both databases then ?
> >
> > I'm actually not sure. I will take a look at the code, it should made
> > possible if it currently isn't. I'll let you know if someone else
> > doesn't answer.
> >
> > Did you try what you have above?
> 
> You can use multiple databases, but I'm not sure adaptors are bound to
> individual databases any where.  I'm pretty certain that there isn't
> anything preventing the addition of such functionality (if it doesn't
> exist already).  If we do add it, we need to update the corresponding
> xdocs document as well.  Jason, if it's not there I'll do either task
> if you like (splitting the work).
> 
> Daniel
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: More than one database.adaptor ?

Posted by Daniel Rall <dl...@collab.net>.
Jason van Zyl <jv...@apache.org> writes:

> "Albrecht F.Leiprecht" wrote:
> > 
> > Is it possible to have more than one Database adaptors like :
> > 
> > database.adaptor=DBMM, DBAD
> > database.adaptor.DBMM=org.gjt.mm.mysql.Driver
> > database.adaptor.DBAD=de.sag.jdbc.adabasd.ADriver
> > 
> > can I use both databases then ?
> 
> I'm actually not sure. I will take a look at the code, it should made
> possible if it currently isn't. I'll let you know if someone else
> doesn't answer.
> 
> Did you try what you have above?

You can use multiple databases, but I'm not sure adaptors are bound to
individual databases any where.  I'm pretty certain that there isn't
anything preventing the addition of such functionality (if it doesn't
exist already).  If we do add it, we need to update the corresponding
xdocs document as well.  Jason, if it's not there I'll do either task
if you like (splitting the work).

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: More than one database.adaptor ?

Posted by Jason van Zyl <jv...@apache.org>.
"Albrecht F.Leiprecht" wrote:
> 
> Is it possible to have more than one Database adaptors like :
> 
> database.adaptor=DBMM, DBAD
> database.adaptor.DBMM=org.gjt.mm.mysql.Driver
> database.adaptor.DBAD=de.sag.jdbc.adabasd.ADriver
> 
> can I use both databases then ?
> 
> rgds
> albi
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

I'm actually not sure. I will take a look at the code, it should made
possible if it currently isn't. I'll let you know if someone else
doesn't answer.

Did you try what you have above?

-- 
jvz.

Jason van Zyl
jvanzyl@periapt.com

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://tambora.zenplex.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org