dcsimg
(Oracle 10g, JBOSS Connection Pool) - Standalone application executing cursor output type stored procedure
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stephen_Dcruz
Posted On:   Tuesday, February 27, 2007 07:37 AM

Hi Everyone, Has anyone faced issues with executing Cursor output type stored procedures from a standalone application? I have a standalone application which gets the database connection from the JBoss connection pool. Please have a look at the following lines of code String sSql = "{call some_proc(?,?)}"; Connection oCurCon = getConnectionOra(); CallableStatement cstmt = oCurCon.prepareCall(sSql); cstmt.setString(1, "param1"); cstmt.registerOutParameter(2, OracleTypes.Cursor); cstmt.execute(); ResultSet rs = (ResultSet) cstmt.getObject(2); /   More>>

			
Hi Everyone,

Has anyone faced issues with executing Cursor output type
stored procedures from a standalone application?


I have a standalone application which gets the
database connection from the JBoss connection pool.
Please have a look at the following lines of code




String sSql = "{call some_proc(?,?)}";

Connection oCurCon = getConnectionOra();

CallableStatement cstmt = oCurCon.prepareCall(sSql);

cstmt.setString(1, "param1");
cstmt.registerOutParameter(2, OracleTypes.Cursor);

cstmt.execute();

ResultSet rs = (ResultSet) cstmt.getObject(2);

// Even tried with below line of code

//ResultSet rs = ((OracleCallableStatement)cstmt).getCursor(2);

if(rs.next()){

System.out.println("Has records.");

}



When I try to execute, it gives an exception
saying "$proxy3" and no other useful message. I think
it is unable to map the ResultSet object with the
Oracle equivalent class (OracleResultSetImpl). I have no idea about the solution.



The ojdbc14.jar is set correctly to the CLASSPATH. The
code works fine when I execute a stored procedures which has output type declared as Integer, or any other
except the REF CURSOR.




Any Help or pointer would be great.



Thanks

   <<Less

Re: (Oracle 10g, JBOSS Connection Pool) - Standalone application executing cursor output type stored procedure

Posted By:   Anonymous  
Posted On:   Wednesday, March 7, 2007 08:21 AM

Hi !

I got the same problem ! I have noticed that the Connection provided by the Descriptor (xxx-ds.xml) is just a proxy while the one provided by :
conn = DriverManager.getConnection(...) is a T4CConnection type !

Could anyone help us ?

thank you

Adil
About | Sitemap | Contact