It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes ClassCastException with Connection Pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ClassCastException with Connection Pooling" Watch "ClassCastException with Connection Pooling" New topic

ClassCastException with Connection Pooling

Graeme Byers
Ranch Hand

Joined: Apr 16, 2004
Posts: 127
ClassCastException with Connection Pooling

This one may belong in Beginner's Java , however ...
I'm following Gregg Lagnese "How to Setup Global Mapping for Oracle JDBC Connection Pooling with Tomcat")

Thank you for any help.

Environment : Apache-Tomcat 6.0.18 , Oracle XE 10.2.0

The JSP :

The JSP output (neatly arranged) :

The program :

Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

I observed the following.
* Why do you get a connection pool in JSP?!
* Lines 25 & 28 : Why do you get the resource twice?
* If an exception is thrown on-or-before line 30, NullPointerException will be thrown, when the finally block executes !

Not many get the right opportunity !
I agree. Here's the link:
subject: ClassCastException with Connection Pooling
It's not a secret anymore!