tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Dai <ddai...@ddai.net>
Subject Re: Newbie - JDBC problem "Name is not bound in this context"
Date Sat, 07 Aug 2004 20:42:52 GMT
On 8/7/2004 8:24 AM, ohaya wrote:

> Hi,
> 
> I just got Tomcat 5.0.27 installed (with Apache 2.0.50), and am trying
> to get a simple JDBC JSP working.  The JSP is called 'test.jsp'.
> 
> I have the JDBC-ODBC bridge installed and am going through that.  I've
> been using the bridge driver from standalone Java applications, so I
> think that is working ok, but even with a really simple JSP, I'm getting
> an "Name jdbc is not bound in this context" error.
> 
> I'm including my server.xml, test.jsp, and the error details below.
> 
> I was wondering if anyone could tell me what I'm doing wrong?
> 
[snipped]
> 
> 
> and here's my JSP:

...
> Context ic = new InitialContext();
> DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/jimnew");

I'm not a JNDI expert but you can try this:

Context ic = new InitialContext();
Context ctx = (Context) ic.lookup("java:comp/env");
DataSource ds = (DataSource) ic.lookup("jdbc/jimnew");

-- 
Dennis Dai
ddai-ml@ddai.net

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message