commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell" <flame...@gmail.com>
Subject Re: JNDI + dbcp + commons-dbcp-1.2.1.jar
Date Fri, 09 Feb 2007 06:36:43 GMT
At a guess, the Oracle code is trying to cast the connection to
OracleConnection or some such. It's not an OracleConnection as DBCP
wraps that with its own Connection implementation.

Try doing:

adTemp = ArrayDescriptor.createDescriptor("ARR_VARCHAR",
 ((DelegatingConnection)con).getDelegate() );

with an import of:

import org.apache.commons.dbcp.DelegatingConnection;

Hen

On 2/8/07, karthik <karthikn@xius.org> wrote:
>
>  Hi
>
>    Currently ,When i wanted to port my application "xyz.war" from  OC4j
> (oracle) to TOMCAT5.5
>    I found some problems regarding JNDI usage in tomcat with Commons DBCP
>
> I have made use of Resource tag as follows
>
> <Resource name="jdbc/tomcattest"
> auth="Container"
> type="javax.sql.DataSource"
> driverClassName="oracle.jdbc.driver.OracleDriver"
> url="jdbc:oracle:thin:@//192.168.150.112:11654/xyz"
> username="voise_20"
> password="voise_20"
> maxActive="100"
> maxIdle="10"
> maxWait="-1"/>
>
>
>    I still get the cast exception as below for Array Discriptor being used
>
>    java.lang.ClassCastException
>         at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:108)
>         at
> com.xius.infinet.ums.UMSBusinessClass.makeNewRolesAdmin(UMSBusinessClass.jav
> a:423)
>
>
>    The Code being used  is as follows
>
> 1>>  con = (DBConnectionManager.getInstance()).getConnection();
> 2>>  htReturnData = new Hashtable();
> 3>>  adTemp = ArrayDescriptor.createDescriptor("ARR_VARCHAR", con);
> 4>>  ar = new ARRAY(adTemp, con, saPrivileges);
> 5>>  OracleCallableStatement cstmt = null;
> 6>>  InfinetUtility.log("UMSBusinessClass.makeNewRolesAdmin " + "{CALL
> UMS_ADMIN.ROLEPROFILE_INSERT(?,?,?,to_number(?),?)}");
> 7>>  cstmt = (OracleCallableStatement) con.prepareCall("{CALL
> UMS_ADMIN.ROLEPROFILE_INSERT(?,?,?,to_number(?),?)}");
> 6>>  cstmt.setString(1, sRoleName);
> 9>>  cstmt.setString(2, sRoleDesc);
> 10>> cstmt.setARRAY(3, ar);
> 11>  cstmt.setString(4, new String("" + iNwId));
> 12>> cstmt.registerOutParameter(5, java.sql.Types.INTEGER);
> 14>  cstmt.execute();
>
>
> The exact nature of problem lies in line number "7" where ever the casting
> happens
>
>
> plz Can somebody explain me why am i getting this error as a result of using
> "commons-dbcp-1.2.1.jar"
>
>
>
> with regards
> Karthik
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

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


Mime
View raw message