geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rik" <...@fundum.net>
Subject RE: Database pool problem
Date Sun, 03 Sep 2006 20:55:21 GMT
Hi, 


Do you still have those errors if you replace your code with the following?

javax.naming.InitialContext ctx = new javax.naming.InitialContext();
javax.sql.DataSource ds = ctx.lookup("java:comp/env/jdbc/cl");
javax.sql.Connection con = ds.getConnection();


Rik

Within my code I attempt to access the pool as follows:

         InitialContext ctx = new InitialContext();
         DataSource ds = ctx.lookup("java:comp/env/jdbc/cl");
         Connection con = ds.getConnection();

When the page executes I receive the following errors:
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 12 in the jsp file: /demo/pooltest.jsp
Generated servlet error:
InitialContext cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /demo/pooltest.jsp
Generated servlet error:
InitialContext cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /demo/pooltest.jsp
Generated servlet error:
DataSource cannot be resolved to a type

Could someone tell me what I've done incorrectly?  The process seems  
straightforward, but I've done something incorrectly.

Thanks,
Bob



Mime
View raw message