Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Solved: JDBC Connection Pool Problem

 
Darren Wilkinson
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change your resource

to


You are looking with wrong context name . Try it,
 
Darren Wilkinson
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Sagar - your suggestion solved the problem.

I can now dip my sql in a live connection pool :-)
 
Manon Baratt
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the suggestion here helped me get the code working:
http://forums.sun.com/thread.jspa?threadID=563682&messageID=2775875
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic