• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Solved: JDBC Connection Pool Problem

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Sagar - your suggestion solved the problem.

I can now dip my sql in a live connection pool :-)
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic