File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Products
»
Tomcat
Author
Error - Name jdbc is not bound in this Context
Malith Yapa
Ranch Hand
Joined: Jan 17, 2007
Posts: 45
posted
Jul 28, 2007 08:31:00
0
I've written the context like this..
<Context path="/malith"> <Resource name="jdbc/h2" auth="Container" type="javax.sql.DataSource" driverClassName="org.h2.Driver" url="jdbc:h2:file:c:/data/db" username="sa" password="" maxActive="20" maxIdle="10" maxWait="-1"/> </Context>
And i'm using this code to retrive the datasource
InitialContext context = new InitialContext(); DataSource data = (DataSource)context.lookup("java:/comp/env/jdbc/h2"); if(data != null) { throw new SQLException(sb.toString()); } return data.getConnection();
But i get the following exception :-(
javax.naming.NameNotFoundException
: Name
jdbc
is not bound in this Context
Cant understand it.. Pleeease help..
[ July 28, 2007: Message edited by: Bear Bibeault ]
I agree. Here's the link:
http://jrebel.com/download
subject: Error - Name jdbc is not bound in this Context
Similar Threads
Help: upgraded from tomcat 5.0 to 5.5.27 and getting Naming Exception
how to use a datasource that defined in Tomcat admin console inside a servlet
look up datasource from session bean
How to Resolve this exception in tomcat 5.0.28
JNDI, xxx is already bound
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter