Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getInnerMostDelegate not working

509387Apr 27 2006 — edited Mar 3 2007
Hi ,
I need to pass an array to a stored procedure but Iam stuck up at getting the underlying connection.

My env is --

Server : Tomcat
1. commons-dbcp-1.2.1.jar, classes12.jar in common/lib folder.
2. My data source setting --

<!-- Connection pool testing AJAY -->
<Resource
name="jdbc/ddmoracle"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
accessToUnderlyingConnectionAllowed="true"
url="jdbc:oracle:thin:@192.168.192.27:2200:LBSL"
username="preit03"
password="preit"
maxActive="20"
maxIdle="10"
maxWait="-1"/>


My code --

private int setDistributionSetVersionPriority(Connection conn, int[] lRelVersions , long lUserId)
throws Exception
{

int iReleaseFlag = 0;
try
{
CallableStatement objCallStmt = null;
objCallStmt = conn.prepareCall("CALL PKDSTVERSION.PRSETPRIORITY(?,?,?)");

Connection oracleConnection = conn;

//exception is thrown at the following line
oracleConnection = ((DelegatingConnection) conn).getInnermostDelegate();

ArrayDescriptor descriptor =
ArrayDescriptor.createDescriptor( "NUM_ARRAY", oracleConnection );
ARRAY array_to_pass =
new ARRAY( descriptor, oracleConnection, lRelVersions );

objCallStmt.setArray(1, array_to_pass);
objCallStmt.setLong(2,lUserId);
objCallStmt.registerOutParameter(3,Types.INTEGER);
objCallStmt.executeUpdate();
iReleaseFlag = objCallStmt.getInt(3);
CommonAPI.log(_lUserId, "DistributionDAOImpl", "setDistributionSetVersionPriority",
"Executed PKDSTVERSION.PRSETPRIORITY, iReleaseFlag = "+ iReleaseFlag, DDMConstants.INFO);
}
catch(Exception ex)
{
System.out.println("in set Priority :"+ex.getMessage());
}
return iReleaseFlag;
}

The message displayed in the catch is -- org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

Any directions from you would be of great help.

Thanks
-Aj
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2007
Added on Apr 27 2006
5 comments
5,597 views