Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unable to send XML input to a stored Procedure

SA-49290

Summary



Unable to send XML parameters from the application to an Oracle stored procedure in a CALL method.


Error Messages



Not Applicable


Steps to Reproduce



Unknown


Root Cause



Not Applicable


Resolution



Use the below code from the Java step.

java.sql.Connection con = null;
java.sql.CallableStatement stmt = null;
oLog.error("First line");
try {

java.lang.Class.forName("oracle.jdbc.driver.OracleDriver");
con = java.sql.DriverManager.getConnection(
"<jdbc-rul>",
"<username>", "<password>");


stmt = con.prepareCall("{CALL PM_PEGA_TEST_INPUT(XMLType(?))}");


stmt.setObject(1, "<abc>1</abc>");
oLog.error("After setString call");
// stmt.setInt(1,45);

oLog.error("After setobject ");
stmt.execute();
//oLog.error("After execute"+stmt.getInt(2));
oLog.error("After execute");
oLog.error("Created DB Connection...." + con);
} catch (ClassNotFoundException e) {

e.printStackTrace();
} catch (java.sql.SQLException e) {

e.printStackTrace();
} finally {
try{
if (con != null)
con.close();
if (stmt != null)
stmt.close();
}catch(java.sql.SQLException e){
e.printStackTrace();
}
}



Published May 23, 2018 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us