One Star

Returning output parameters from a jdbcSP call to a stored procedure.

I am able to retrieve stored procedure outputs using a tJavaFlex widget.   
java.sql.Connection connection_tJDBCSP_1 = (java.sql.Connection) globalMap.get("conn_tJDBCConnection_1");
String sql = "call WEB_ORDER_2020(?,?,?,?)";
java.sql.CallableStatement stmt = connection_tJDBCSP_1.prepareCall( sql );
stmt.registerOutParameter(1, -1);
stmt.registerOutParameter(2, -1);
stmt.registerOutParameter(3, -1);
stmt.registerOutParameter(4, -1);
java.sql.ResultSet rs = stmt.executeQuery();

System.out.println( "WEB_ORDER_2020 returns : " + stmt.getString( 1) + stmt.getString( 2) + stmt.getString( 3) + stmt.getString( 4));
rs.close();
stmt.close();

However when I use the tJDBCSP widget and look at the generated code, I don't see the registerOutParameter 
statements between the PrepareCall and the executeQuery.   And I cannot examine the returned values.
Any help would be appreciated.
1 REPLY
Community Manager

Re: Returning output parameters from a jdbcSP call to a stored procedure.

Hi 
You need to define the columns on the schema of tJDBCSP, and select columns as out type in the Parameters table.
BR
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business