tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Burgess, Jay S" <Jay.Burg...@ca.com>
Subject RE: Another Try at MySQL Connection Pooling
Date Wed, 11 Feb 2004 19:09:07 GMT
I forgot whether your original post showed it or not, but how are you
trying to acquire the resource in your code?  It should look something
like:

Context initialContext = new InitialContext();
Context envContext = (Context) initialContext.lookup("java:comp/env");
this.dataSource = (DataSource) envContext.lookup("jdbc/TimesheetsDB ");

Just a thought, in case you've got one of the strings wrong.

Jay

-----Original Message-----
From: Merrill Cornish [mailto:merrill.cornish@earthlink.net] 
Sent: Wednesday, February 11, 2004 11:43 AM
To: Tomcat Users List
Subject: Re: Another Try at MySQL Connection Pooling

David,

I THINK I've figure out that MySQL's Connector/J jar worked in
jre/lib/ex when I was using DriverManager because only MySQL needed to
see it, and it knew to look in jre/lib/ex.  However, with DataSource,
I'm assuming it's Tomcat who needs to see it, so it needs to be in
Tomcat's common/lib. 

So I put Connect/J's jar in common/lib--and it still failed in the same
manner.

I'm wondering if the actual error message MIGHT be giving a clue.  It
says "Name jdbc is not bound in this Context" when the only thing that
EVER appears in any of the XML is "jdbc/TimesheetsDB". 

  * Does this imply that "jdbc/TimesheetsDB" is wrong and the entries
should be something like simply "TimesheetsDB"?

   * Does this imply that "jdbc" has to be declared in some manner
before "jdbc/TimesheetsDB" can be declared?


Merrill

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



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


Mime
View raw message