How to get OUT parameter greater than 4000 char from an oracle stored procedure with jdbc ?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   matthieu_maligorne
Posted On:   Saturday, December 6, 2008 10:25 AM

I try to get an OUT parameter of type LONG from an oracle stored procedure (Oracle 9i). I use a driver 11.0.1 (ojdbc6.jar) and the following code: connection = getConnection(); cstmt = connection.prepareCall("CALL " + sp_name + "(?,?,?,?,?)"); cstmt.setString(1, pTypeEntree); cstmt.setString(2, pDataIn); cstmt.registerOutParameter(3, Types.LONGVARCHAR); cstmt.registerOutParameter(4, Types.LONGVARCHAR); cstmt.registerOutParameter(5, Types.LONGVARCHAR); cstmt.executeUpdate(); String pDataOut = cstmt.getString(3); String pRetour = cstmt.getString(4); String pLibErr = cstmt.getString(5)   More>>

I try to get an OUT parameter of type LONG from an oracle stored procedure (Oracle 9i). I use a driver 11.0.1 (ojdbc6.jar) and the following code:

			
connection = getConnection();
cstmt = connection.prepareCall("CALL " + sp_name + "(?,?,?,?,?)");

cstmt.setString(1, pTypeEntree);


cstmt.setString(2, pDataIn);


cstmt.registerOutParameter(3, Types.LONGVARCHAR);


cstmt.registerOutParameter(4, Types.LONGVARCHAR);

cstmt.registerOutParameter(5, Types.LONGVARCHAR);


cstmt.executeUpdate();

String pDataOut = cstmt.getString(3);

String pRetour = cstmt.getString(4);

String pLibErr = cstmt.getString(5);

			
But when an OUT parameter is geater than 4000 char , it fails (java.sql.Exection character buffer too small)
I have read that this a limitation of the driver that accept only LONG parameter smallest than 4000.
I there a mean to achieve that ?
I have tried to use steaming :getCharacterStream() instead of getString but it is not implemented in the pool i use: dbcp this method is abstract in DelegatingCallableStatement.
thanks in advance.

regards.    <<Less
About | Sitemap | Contact