tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chandramouli Kharidehal <Ckharide...@sapient.com>
Subject JNDI Context
Date Mon, 28 Jan 2002 05:05:35 GMT
Hi
     How do i set up connection Pooling with JNDi context I browsed the
archives and did all that were suggested 
     but still it doesn't work . What i need to do to work this Connection
Pooling !! 
       
 <%
    try {
    InitialContext ctext = new InitialContext();
    System.out.println("inside INit ");
  
    javax.naming.Context env = (Context)ctext.lookup("java:comp/env");
      
    // use the greetings message
  
   %>
    <p> Before lookup </p>
    <%
   OracleDataSource oc =  (OracleDataSource)env.lookup("jdbc/cnamsbld");
  
%>
<p> After lookup </p>

<%
    
    Connection connection = oc.getConnection();
    System.out.println(" connection " + connection);
    }
     
     catch(Exception e) {
       out.println(e);
     }

Iam running this scriplet but iam getting
javax.naming.NameNotFoundException: Name java:comp is not bound of this
context 

Thanks 
Mouli 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message