commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Tomsic <ptom...@yahoo.com>
Subject Re: dataSource.getConnection fails from within tomcat
Date Sat, 14 Dec 2002 23:46:24 GMT
well, the readme for MySQL connector/j 2.0.14
(formerly mm.mysql - mark matthews)
describes the usage for this JAR
as "com.mysql.jdbc.Driver"
(http://www.mysql.com/downloads/api-jdbc-stable.html)

how should I be doing it?

As for the URL, 
driver.registerPool("dow", connectionPool);
Connection conn =
DriverManager.getConnection("jdbc:apache:commons:dbcp:dow");

I thought was the correct way, from:

http://jakarta.apache.org/commons/dbcp/api/index.html

I'm just wondering why it works locally (outside a
Tomcat env.) but when I integrate it into our tomcat
env. it fails.

any thoughts?

thanks again, and sorry if I'm being thick-headed
here,

Paul




> This does not appear to be a JDBC URL that any
> driver I know of would
> recognize.
> 
> > > ----stack trace of error--------
> > > org.apache.commons.dbcp.DbcpException:
> > > java.sql.SQLException: No suitable driver
> 
> That's exactly the exception I would expect from the
> URL noted above.
> 
> Craig
> 
> 

--- "Craig R. McClanahan" <craigmcc@apache.org> wrote:
> See below.
> 
> On Fri, 13 Dec 2002, James Strachan wrote:
> 
> > Date: Fri, 13 Dec 2002 18:00:43 -0000
> > From: James Strachan <james_strachan@yahoo.co.uk>
> > Reply-To: Jakarta Commons Users List
> <commons-user@jakarta.apache.org>
> > To: Paul Tomsic <ptomsic@yahoo.com>,
> commons-user@jakarta.apache.org
> > Subject: Re: dataSource.getConnection fails from
> within tomcat
> >
> > Can anyone spot Pauls problem for him? Could it be
> a class loading issue?
> >
> > ----- Original Message -----
> > From: "Paul Tomsic" <ptomsic@yahoo.com>
> > To: <james_strachan@yahoo.co.uk>
> > Sent: Friday, December 13, 2002 5:55 PM
> > Subject: dataSource.getConnection fails from
> within tomcat
> >
> > > James,
> > >
> > > we exchanged a few emails a while ago about a
> > > persistence problem that I was having from
> within
> > > tomcat.
> > > Sorry to email you directly, but I'm not having
> any
> > > success getting answers from the mailing list,
> so I
> > > thought I'd take a chance and ask you directly.
> > > Again, my apologies, but I can't seem to correct
> this
> > > problem.
> > >
> > > I'm able to connect to a MySQL dB using a stand
> alone
> > > file (see below), but when I put the exact same
> code
> > > into our application from within Tomcat, I get a
> > > nullPointer on the
> > > conn = dataSource.getConnection()
> > > line.
> > >
> > > you wouldn't have any thoughts as to why this is
> > > happening, or even a suggestion as to where I
> could
> > > start troubleshooting, would you?
> > > It's just odd that I can do it stand-alone, but
> when
> > > mixed w/ Tomcat, I get that nullpointer, but no
> real
> > > explaination.
> > >
> > >
> > > thanks again, and sorry for the direct email
> bother.
> > >
> > > ---stack trace and code from within tomcat----
> > > ----code from within tomcat----
> > > System.setProperty("jdbc.drivers",
> > > "com.mysql.jdbc.Driver");
> > > GenericObjectPool connectionPool = new
> > > GenericObjectPool(null);
> > > ConnectionFactory connectionFactory = new
> > >
> >
>
DriverManagerConnectionFactory("jdbc:mysql://10.117.7.18:3306/dow?autoReconn
> > ect=true",
> > > "user", "pass");
> > > connectionPool.setMaxActive(10);
> > > connectionPool.setMaxIdle(10);
> > > connectionPool.setMaxWait(10);
> > >
> > > PoolableConnectionFactory
> poolableConnectionFactory
> > > = new
> PoolableConnectionFactory(connectionFactory,
> > > connectionPool, null, null, false, true);
> > > PoolingDriver driver = new PoolingDriver();
> > > driver.registerPool("dow", connectionPool);
> > > Connection conn =
> > >
>
DriverManager.getConnection("jdbc:apache:commons:dbcp:dow");
> > >
> 
> This does not appear to be a JDBC URL that any
> driver I know of would
> recognize.
> 
> > > ----stack trace of error--------
> > > org.apache.commons.dbcp.DbcpException:
> > > java.sql.SQLException: No suitable driver
> 
> That's exactly the exception I would expect from the
> URL noted above.
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:commons-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-user-help@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Mime
View raw message