This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Solved: JDBC Connection Pool Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Solved: JDBC Connection Pool Problem" Watch "Solved: JDBC Connection Pool Problem" New topic
Author

Solved: JDBC Connection Pool Problem

Darren Wilkinson
Ranch Hand

Joined: May 22, 2007
Posts: 35
Hello,

I have been following this tutorial - Netbeans JDBC Tutorial. I have tried something slightly different as I need my app to work differently and I have run into a problem.

I get javax.naming.NameNotFoundException: Name jdbc is not bound in this Context when I try to run the following.

Note: I am using Netbeans 6, Tomcat 6. I have connected NB to my MySQL database from within the IDE without a problem.



I have checked and the driver is installed in tomcat (the IDE did it).

At a loss trying to understand what I have done wrong here - but clearly I have done something wrong - I just want a pool to dip my sql in :-(

Any help would be cool.

thanks.
[ July 30, 2008: Message edited by: Darren Wilkinson ]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Change your resource

to


You are looking with wrong context name . Try it,


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Darren Wilkinson
Ranch Hand

Joined: May 22, 2007
Posts: 35
Thank you Sagar - your suggestion solved the problem.

I can now dip my sql in a live connection pool :-)
Manon Baratt
Ranch Hand

Joined: Jan 30, 2006
Posts: 58
I have a similar problem. I am using the suggestion given. I Still get the error: Name jdbc is not bound in this Context.
I installed a new instance of Tomcat. I ran it twice and got no error. Then on the third time I get the above error. I am closing connections in the code. I am using Tomcat 5.0.28. I am using defaults for Tomcat service as below:

<Service name="Catalina">
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" port="8080" redirectPort="8443" maxSpareThreads="75" maxThreads="150" minSpareThreads="25">
</Connector>
<Connector port="8009" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" redirectPort="8443">
</Connector>
Manon Baratt
Ranch Hand

Joined: Jan 30, 2006
Posts: 58
Using the suggestion here helped me get the code working:
http://forums.sun.com/thread.jspa?threadID=563682&messageID=2775875
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Solved: JDBC Connection Pool Problem