I configured the JDBC Data Sources in the JRun and
tested the connection. The connection with the
database is successful. In the servlet, I have a
datasource object and I defined the JNDI Initial
Context object and tried to look up the datasource in
the intial context object.
My code is as follows:
// Get the JNDI context
context = new InitialContext(); //
Lookup the datasource
DataSource ds = (DataSource)context.lookup("java:comp/env/jdbc/" +
dsn);
// Get the connection from the datasource
con = ds.getConnection();
Where dsn is the value I gave while
cofiguring Data source services in JRun 3.0.
I get this exception when I invoke my servlet:
javax.naming.NameNotFoundException:
It is not finding my datasource. This is the messgae I see in the
logs
warning (jdbc) Binding exception: java:comp not found
Please help!
===========================================================================
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