You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Evan Schnell <es...@nvisia.com> on 2003/08/20 22:48:05 UTC

Re: [OT]Oracle JDBC error

Kevin wrote:

>I am a newbie to Struts.
>
>When I try to use the Oracle JDBC extension to take advantage of the Oracle batch update feature, I got an
>exception "org.apache.commons.dbcp.DelegatingPreparedStatement"
>It happens when I try to cast a PrepareStatement to OraclePreparedStatement. (It works fine without the cast)
>
>Any idea why?
>  
>
What is going on here is that you are getting a commons connection pool 
statement which wraps the Oracle statement but not an Oracle statement 
itself. 

What you are trying to do is not exactly sanctioned by J2EE.  The 
container has no obligation to give you a particular class of 
DataSource, Connection, or Statement based upon the Driver class.  It is 
only required to give you something that implements the interface. 

That said, I am not sure why you need to cast to a special Oracle 
object; the java.sql.PreparedStatement interface supports batch updates 
abstractly. 

Evan.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org