• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Tomcat4.1 ConnectionPool ( javax.naming.NameNot Found Exception: Name java:

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pls help me how to do Connection pool in Tomcat4.1
I have written following lines in My jsp.
I have all jar files(naming-common.jar,naming-factory.jar,ojdbc14_g.jar,jndi.jar etc..) in tomcat\common\ lib folder
<%@ page import="javax.naming.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import="java.sql.*"%>

Connection conn=null;
Statement stmt=null;

Context initContext = new InitialContext();
Context ctx=(Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)ctx.lookup("jdbc/timeDB");
conn = ds.getConnection();
}catch(Exception e)
{System.out.println(" exception Created "+e);

In server.xml file i added following lines

<Resource name="jdbc/timeDB" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/timeDB">

<parameter><name>url</name><value>jdbc racle:thin:@xxxxxxx:1521:TESTING</value></parameter>

in web.xml i added folllowing lines

<description>oracle database</description>

<env-entry >
<env-entry-name>data.source.name</env-entry-name >
<env-entry-type>java.lang.String</env-entry-type >
<env-entry-value>jdbc/timeDB</env-entry-value >
</env-entry >

After running JSp , i am getting following errors:
exception Created javax.naming.NameNotFoundException: Name java: is not bound in this Context

Pls help : my Mail id is partha_samantaray@rediffmail.com

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you got this before your connection pool declaration in server.xml?

replace contextname with your context name

here is mine
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!