Rahul Akolkar wrote:
javax.naming.Context
Thank Rahul that help, but now I have another problem. When I use the
tomcat example JSP tags page:
This works!!!!
*******************************************************************************
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<sql:query var="rs" dataSource="rofDB">
select id, foo, bar from testdata
</sql:query>
<html>
<head>
<title>DB Test</title>
</head>
<body>
<h2>Results</h2>
<c:forEach var="row" items="${rs.rows}">
Foo ${row.foo}<br/>
Bar ${row.bar}<br/>
</c:forEach>
********************************************
The following throws:
Name rofDB is not bound in this Context.
Please Help!
thanks
**************************************************************************************
<%@ page
import = "java.io.*"
import = "java.lang.*"
import = "java.sql.*"
import = "javax.naming.*"
import = "java.util.*"
%>
<%
Context ctx = null;
javax.sql.DataSource rofDS = null;
try
{
java.util.Date now = new java.util.Date();
ctx = new InitialContext();
out.println("before lookup " + now + "<br>");
rofDS = (javax.sql.DataSource)ctx.lookup("/rofDB");
out.println("after lookup<br>");
}
catch (Exception ne)
{
out.println(ne.getMessage());
}
%>
--
Darryl Wagoner - WA1GON
"Evil triumphs when good men do nothing." - Edmund Burke [1729-1797]
Join the TrustedQSL mailing list. An Open Source solution.
Post message: [EMAIL PROTECTED] Subscribe: [EMAIL PROTECTED] List owner:
[EMAIL PROTECTED] http://www.trustedQSL.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]