see err : javax.servlet.ServletException: Name jdbc is not bound in this [message #216318] |
Fri, 26 January 2007 06:53 |
mfa786
Messages: 210 Registered: February 2006 Location: karachi
|
Senior Member |
|
|
hi master
sir i not change in sever.xml and web.xml
some body give me idea i change in only Context.xml in META-INF folder
this is Context.xml code
<?xml version="1.0" encoding="UTF-8" ?>
<Context path="/dcp" privileged="true">
<Resource name="jdbc/postgres" auth="Container"
type=" javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@127.0.0.1:1521:aamir"
username="muhammad" password="mfa786" maxActive="1" maxIdle="0" maxWait="-1"/>
</Context>
*********
and this is my jsp code
<HTML>
<%@ page import="java.sql.*,java.util.*" %>
<%@ page import="javax.sql.DataSource" %>
<%@ page import="javax.naming.Context" %>
<%@ page import="javax.naming.InitialContext"%>
<%
Context initContext = new InitialContext();
DataSource ds = (DataSource)initContext.lookup("java:comp/env/jdbc/myOracleDataSource");
Connection conn = ds.getConnection();
%>
<br>
TEST DONE!
</HTML>
but sir jsp page give me error
javax.servlet.ServletException: Name jdbc is not bound in this Context
please give me idea how i run my jsp page
thank'
aamir
|
|
|