This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes JDBC fails with Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC fails with Tomcat" Watch "JDBC fails with Tomcat" New topic

JDBC fails with Tomcat

O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

I am trying to send an array to a pl/sql module but for some reason i am unable to get the connection object.

Here is the line of code that fails

Here is the stack trace

And here is my connection config

Struts Web.xml file


[ September 26, 2008: Message edited by: O. Ziggy ]
[ September 26, 2008: Message edited by: Bear Bibeault ]
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3740

For starters, Oracle and your driver are the culprit, not JDBC. This is one of the reasons I strongly recommend against Oracle-specific implementations of JDBC. You should be using interface classes like Statement/Callable, and not relying on Oracle classes lest you never want to be able to port your code to a new database.

As for the error, since you're getting a ClassCastException exception its most likely your class path. Are you 100% its not failing on this line? The exception makes more sense if this is the bad line:

[OCA 8 Book] [Blog]
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3740

Btw thanks O Ziggy, you helped inspired #4 in my recent blog post 5 Tips to be a Good JDBC Programmer
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: JDBC fails with Tomcat
jQuery in Action, 3rd edition