You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Stéphane Rault <st...@selic.fr> on 2007/09/06 09:00:26 UTC

[DBCP] Newbie question again

Hello again

I repost my question. Perharps, my question is difficult to understand due
to my poor english ? Or there is no solution for my problem with DBCP ? Or
the answer is evident and I didn't found it ?

Thanks in advance.

Stéphane.

-----Message d'origine-----
De : Stéphane Rault [mailto:stephane.rault@selic.fr] 
Envoyé : mardi 4 septembre 2007 11:08
À : 
Objet : Newbie question

Hello everybody.
 
I'm using BasicDataSource to work with differents database in our own
database pool. My problem is that I must work with different version of
Oracle that need different versions of the same class. Is there a
possibility to precise the needed jar with the driver class (I can also give
an URLClassLoader to localize the jar to the corresponding version).
 
Can DBCP help me there ?
 
Thanks in advance.
 
Stéphane.


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


Re: [DBCP] Newbie question again

Posted by Phil Steitz <ph...@gmail.com>.
On 9/6/07, simon <sk...@apache.org> wrote:
> Yep. Oracle really screwed up with their drivers. An old one which is
> not compatible with new DBs. A new one that is not backwards compatible.
> And both use the same classname. Sigh.
>
> Stephane, your English was fine the first time, I just think that very
> few people have needed to load both the old and new drivers at the same
> time (which is what I presume you are trying to do).
>
> I think you are really asking why DBCP doesn't provide a way for code to
> pass the driver class in, rather than just pass the name of the driver
> class in. In other words, why BasicDataSource has
>   public void setDriverClassName(String name)
> but not
>   public void setDriverClass(Class clazz);
>
> Is that right?

This is not possible with BasicDataSource, but you can load the driver
yourself by following the ManualPoolingDataSource example here:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/

Phil

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


RE: [DBCP] Newbie question again

Posted by Stéphane Rault <st...@selic.fr>.
I didn't try it yet but it sounds very good.

Thank you for your response !!! 

> -----Message d'origine-----
> De : simon [mailto:skitching@apache.org] 
> Envoyé : jeudi 6 septembre 2007 21:39
> À : Jakarta Commons Users List
> Objet : RE: [DBCP] Newbie question again
> 
> Yep. Oracle really screwed up with their drivers. An old one 
> which is not compatible with new DBs. A new one that is not 
> backwards compatible.
> And both use the same classname. Sigh.
> 
> Stephane, your English was fine the first time, I just think 
> that very few people have needed to load both the old and new 
> drivers at the same time (which is what I presume you are 
> trying to do).
> 
> I think you are really asking why DBCP doesn't provide a way 
> for code to pass the driver class in, rather than just pass 
> the name of the driver class in. In other words, why 
> BasicDataSource has
>   public void setDriverClassName(String name) but not
>   public void setDriverClass(Class clazz);
> 
> Is that right?
> 
> Regards,
> 
> Simon
> 
> On Thu, 2007-09-06 at 19:13 +0200, Stéphane Rault wrote:
> > I'm afraid this is actually a DBCP qsuestion. Java permit to load 
> > severals versions of the same class using classloaders. In 
> a personal 
> > development, I managed to load 2 drivers separately using 
> > Class.forName(String className, boolean initiliaze, 
> ClassLoader classLoader) twice.
> > But using, DBCP and the BasicDataSourceObject, I can only give the 
> > name of the class.
> > 
> > Is that right ?
> > 
> > Stéphane.
> > 
> > > -----Message d'origine-----
> > > De : jcarman@carmanconsulting.com
> > > [mailto:jcarman@carmanconsulting.com] De la part de James Carman 
> > > Envoyé : jeudi 6 septembre 2007 12:48 À : Jakarta Commons 
> Users List 
> > > Objet : Re: [DBCP] Newbie question again
> > > 
> > > This is not a DBCP question, but a Java question.  I 
> would try using 
> > > the latest JDBC driver, since they are usually compatible 
> with older 
> > > versions of Oracle.
> > > 
> > > On 9/6/07, Stéphane Rault <st...@selic.fr> wrote:
> > > > Hello again
> > > >
> > > > I repost my question. Perharps, my question is difficult to
> > > understand
> > > > due to my poor english ? Or there is no solution for my
> > > problem with
> > > > DBCP ? Or the answer is evident and I didn't found it ?
> > > >
> > > > Thanks in advance.
> > > >
> > > > Stéphane.
> > > >
> > > > -----Message d'origine-----
> > > > De : Stéphane Rault [mailto:stephane.rault@selic.fr] Envoyé
> > > : mardi 4
> > > > septembre 2007 11:08 À :
> > > > Objet : Newbie question
> > > >
> > > > Hello everybody.
> > > >
> > > > I'm using BasicDataSource to work with differents database
> > > in our own
> > > > database pool. My problem is that I must work with
> > > different version
> > > > of Oracle that need different versions of the same class. 
> > > Is there a
> > > > possibility to precise the needed jar with the driver 
> class (I can 
> > > > also give an URLClassLoader to localize the jar to the
> > > corresponding version).
> > > >
> > > > Can DBCP help me there ?
> > > >
> > > > Thanks in advance.
> > > >
> > > > Stéphane.
> > > >
> > > >
> > > > 
> > > 
> --------------------------------------------------------------------
> > > -
> > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > For additional commands, e-mail: user-help@commons.apache.org
> > > >
> > > >
> > > 
> > > 
> --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: user-help@commons.apache.org
> > > 
> > > 
> > > 
> > > --
> > > No virus found in this incoming message.
> > > Checked by AVG Free Edition. 
> > > Version: 7.5.485 / Virus Database: 269.13.7/992 - Release
> > > Date: 06/09/2007 08:36
> > > 
> > > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.485 / Virus Database: 269.13.7/992 - Release 
> Date: 06/09/2007 08:36
> 


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


RE: [DBCP] Newbie question again

Posted by simon <sk...@apache.org>.
Yep. Oracle really screwed up with their drivers. An old one which is
not compatible with new DBs. A new one that is not backwards compatible.
And both use the same classname. Sigh.

Stephane, your English was fine the first time, I just think that very
few people have needed to load both the old and new drivers at the same
time (which is what I presume you are trying to do).

I think you are really asking why DBCP doesn't provide a way for code to
pass the driver class in, rather than just pass the name of the driver
class in. In other words, why BasicDataSource has
  public void setDriverClassName(String name)
but not
  public void setDriverClass(Class clazz);

Is that right?

Regards,

Simon

On Thu, 2007-09-06 at 19:13 +0200, Stéphane Rault wrote:
> I'm afraid this is actually a DBCP qsuestion. Java permit to load severals
> versions of the same class using classloaders. In a personal development, I
> managed to load 2 drivers separately using Class.forName(String className,
> boolean initiliaze, ClassLoader classLoader) twice.
> But using, DBCP and the BasicDataSourceObject, I can only give the name of
> the class.
> 
> Is that right ?
> 
> Stéphane.
> 
> > -----Message d'origine-----
> > De : jcarman@carmanconsulting.com 
> > [mailto:jcarman@carmanconsulting.com] De la part de James Carman
> > Envoyé : jeudi 6 septembre 2007 12:48
> > À : Jakarta Commons Users List
> > Objet : Re: [DBCP] Newbie question again
> > 
> > This is not a DBCP question, but a Java question.  I would 
> > try using the latest JDBC driver, since they are usually 
> > compatible with older versions of Oracle.
> > 
> > On 9/6/07, Stéphane Rault <st...@selic.fr> wrote:
> > > Hello again
> > >
> > > I repost my question. Perharps, my question is difficult to 
> > understand 
> > > due to my poor english ? Or there is no solution for my 
> > problem with 
> > > DBCP ? Or the answer is evident and I didn't found it ?
> > >
> > > Thanks in advance.
> > >
> > > Stéphane.
> > >
> > > -----Message d'origine-----
> > > De : Stéphane Rault [mailto:stephane.rault@selic.fr] Envoyé 
> > : mardi 4 
> > > septembre 2007 11:08 À :
> > > Objet : Newbie question
> > >
> > > Hello everybody.
> > >
> > > I'm using BasicDataSource to work with differents database 
> > in our own 
> > > database pool. My problem is that I must work with 
> > different version 
> > > of Oracle that need different versions of the same class. 
> > Is there a 
> > > possibility to precise the needed jar with the driver class (I can 
> > > also give an URLClassLoader to localize the jar to the 
> > corresponding version).
> > >
> > > Can DBCP help me there ?
> > >
> > > Thanks in advance.
> > >
> > > Stéphane.
> > >
> > >
> > > 
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: user-help@commons.apache.org
> > >
> > >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> > 
> > 
> > 
> > --
> > No virus found in this incoming message.
> > Checked by AVG Free Edition. 
> > Version: 7.5.485 / Virus Database: 269.13.7/992 - Release 
> > Date: 06/09/2007 08:36
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


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


RE: [DBCP] Newbie question again

Posted by Stéphane Rault <st...@selic.fr>.
I'm afraid this is actually a DBCP qsuestion. Java permit to load severals
versions of the same class using classloaders. In a personal development, I
managed to load 2 drivers separately using Class.forName(String className,
boolean initiliaze, ClassLoader classLoader) twice.
But using, DBCP and the BasicDataSourceObject, I can only give the name of
the class.

Is that right ?

Stéphane.

> -----Message d'origine-----
> De : jcarman@carmanconsulting.com 
> [mailto:jcarman@carmanconsulting.com] De la part de James Carman
> Envoyé : jeudi 6 septembre 2007 12:48
> À : Jakarta Commons Users List
> Objet : Re: [DBCP] Newbie question again
> 
> This is not a DBCP question, but a Java question.  I would 
> try using the latest JDBC driver, since they are usually 
> compatible with older versions of Oracle.
> 
> On 9/6/07, Stéphane Rault <st...@selic.fr> wrote:
> > Hello again
> >
> > I repost my question. Perharps, my question is difficult to 
> understand 
> > due to my poor english ? Or there is no solution for my 
> problem with 
> > DBCP ? Or the answer is evident and I didn't found it ?
> >
> > Thanks in advance.
> >
> > Stéphane.
> >
> > -----Message d'origine-----
> > De : Stéphane Rault [mailto:stephane.rault@selic.fr] Envoyé 
> : mardi 4 
> > septembre 2007 11:08 À :
> > Objet : Newbie question
> >
> > Hello everybody.
> >
> > I'm using BasicDataSource to work with differents database 
> in our own 
> > database pool. My problem is that I must work with 
> different version 
> > of Oracle that need different versions of the same class. 
> Is there a 
> > possibility to precise the needed jar with the driver class (I can 
> > also give an URLClassLoader to localize the jar to the 
> corresponding version).
> >
> > Can DBCP help me there ?
> >
> > Thanks in advance.
> >
> > Stéphane.
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.485 / Virus Database: 269.13.7/992 - Release 
> Date: 06/09/2007 08:36
> 
> 


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


Re: [DBCP] Newbie question again

Posted by James Carman <ja...@carmanconsulting.com>.
This is not a DBCP question, but a Java question.  I would try using
the latest JDBC driver, since they are usually compatible with older
versions of Oracle.

On 9/6/07, Stéphane Rault <st...@selic.fr> wrote:
> Hello again
>
> I repost my question. Perharps, my question is difficult to understand due
> to my poor english ? Or there is no solution for my problem with DBCP ? Or
> the answer is evident and I didn't found it ?
>
> Thanks in advance.
>
> Stéphane.
>
> -----Message d'origine-----
> De : Stéphane Rault [mailto:stephane.rault@selic.fr]
> Envoyé : mardi 4 septembre 2007 11:08
> À :
> Objet : Newbie question
>
> Hello everybody.
>
> I'm using BasicDataSource to work with differents database in our own
> database pool. My problem is that I must work with different version of
> Oracle that need different versions of the same class. Is there a
> possibility to precise the needed jar with the driver class (I can also give
> an URLClassLoader to localize the jar to the corresponding version).
>
> Can DBCP help me there ?
>
> Thanks in advance.
>
> Stéphane.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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