Thanks. That was the problem.  It was an error in putting the initial
context factory and provider_url.

Thank You
T R Yogeeta

> ----------
> From:         Lee Turner[SMTP:[EMAIL PROTECTED]]
> Reply To:     A mailing list about Java Server Pages specification and
> reference
> Sent:         Wednesday, January 31, 2001 7:48 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Error Accessing Connection pool
>
> Could this be an error accessing the Context and not the connection pool
> ???
> You could try putting a blank username and password in the properties as
> follows:
>
> public static Context getInitialContext() throws NamingException
> {
>         String url = "t3://127.0.0.1:7001";
>         String user = null;
>         String password = null;
>
>         Properties p = new Properties();
>         p.put(Context.INITIAL_CONTEXT_FACTORY,
> "weblogic.jndi.WLInitialContextFactory");
>         p.put(Context.PROVIDER_URL, url);
>
>         if (user != null)
>         {
>                 p.put(Context.SECURITY_PRINCIPAL, user);
>                 if (password == null)
>                         password = "";
>                 p.put(Context.SECURITY_CREDENTIALS, password);
>         }
>         return new InitialContext(p);
> }
>
> Lee
> _________________________________
>
> Lee Turner
> Systems Developer
> _________________________________
>
> Watt Gilchrist Ltd
> Ring Road, West Park
> Leeds, LS16 6RA
> Tel: 0113 288 3200
> Fax: 0113 275 1690
> http://www.wattgilchrist.co.uk
> _________________________________
>
> > -----Original Message-----
> > From: Yogeeta_Raghunathan [SMTP:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 31, 2001 7:10 AM
> > To:   [EMAIL PROTECTED]
> > Subject:      Error Accessing Connection pool
> >
> > Hi,
> >         I created a connection pool under weblogic 5.1 server as below.
> >
> > weblogic.jdbc.connectionPool.bscsPool=\
> >        url=jdbc:weblogic:oracle:IPAdd:Port,\
> >        driver=weblogic.jdbc.oci.Driver,\
> >        initialCapacity=4,\
> >        maxCapacity=10,\
> >        capacityIncrement=1,\
> >        props=user=sysadm;password=sysadm;server=ServerName
> >
> > weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.bscsPool=bscsPool
> >
> > weblogic.allow.reserve.weblogic.jdbc.connectionPool.bscsPool=everyone
> > weblogic.allow.reset.weblogic.jdbc.connectionPool.oraclePool=everyone
> > weblogic.allow.shrink.weblogic.jdbc.connectionPool.oraclePool=everyone
> >
> >
> > The connection pool is created. When I am trying to access it from my
> JSP
> > as
> > below.
> >
> >            try
> >        {
> >
> >                  Context ctx = null;
> >                 System.setProperty("java.naming.factory.initial",
> >                 "weblogic.jndi.WLInitialContextFactory");
> >                 System.setProperty("java.naming.provider.url",
> >                 "t3://127.0.0.1:7001");
> >
> >                  ctx = new InitialContext();
> >                  javax.sql.DataSource ds = (javax.sql.DataSource)
> > ctx.lookup
> > ("bscsPool");
> >                  conn=ds.getConnection();
> >            stmt = conn.createStatement();
> >            System.out.println(conn);
> >
> >      }
> >    catch(Exception e)
> >    {
> >         out.println("Could not connect to the database"+e);
> >    }
> >
> >
> >
> > I am getting the error as
> >
> > java.security.AccessControlException: access denied
> > (java.util.PropertyPermission java.naming.factory.initial write)
> >
> > Should I set some permission for the JSPs?
> >
> > Thank You
> > T R Yogeeta
> >
> >
> ==========================================================================
> > =
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to