tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arora, Avinash" <>
Subject DB connection pool problem
Date Mon, 03 May 2004 22:10:06 GMT
   I am also having the problem with the connection pools. Since I am
writing an application first time by using connection pools, I created a
test application DBTest. I edited my server.xml and web.xml (of my
application in following way--
#added to server.xml
<Context path="/DBTest" docBase="DBTest" debug="0"
            <ResourceParams name="jdbc/conversion">
    <description>MySQL Test App</description>
And I added the following statements to my Java class, (which works
fine, when I use the connection objects by hardcoding the username and

Context init = new InitialContext();
 Context ctx = (Context) init.lookup("java:comp/env");
 DataSource dataSource = (DataSource)ctx.lookup("jdbc/conversion");

But even after, making these changes, I cannot read any thing from
database. I was wondering what more changes I need to made. I also tried
to run my JAVA class (DAO) from command line, but I get the following

Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file:
I tried to print outs the place where exception occurs in my code and
found that exception occurs at
dataSource = (DataSource)ctx.lookup("jdbc/conversion");

Can any body please comment on whats going on wrong? When I run from
command line, is tomcat used, I don't think so? So where is the problem?
Any ideas??
Avinash Arora


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message