The script generates some values to pass along to a stored procedure, and collects the output for use later on in the process. We are not using the OOTB JDBC stored procedure activity because the multiple possible values for sp inputs would have made the process too large to debug (the process recorder can only record so many activities). The script has been running with no issues in our ES4 production environment for almost a decade, so I don't think the script is the issue.
I expect an exception (and get one) if one of my sp parameters is incorrect. I generate the error above when the exception is caught. If I change the code to import com.microsoft.sqlserver.jdbc.SQLServerException; and only catch SQLServerException, I still get the same error.
Here is the script, with the non-stored procedure logic stripped out.
import javax.naming.InitialContext;
import javax.sql.DataSource;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.*;
PreparedStatement stmt = null;
Connection conn = null;
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:/FIN_DS");
//logic to set up sp input parameters goes here
conn = ds.getConnection();
try
{
stmt = conn.prepareCall("{call TransacTable_Insert(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
//set the sp input/output parameters here
stmt.execute();
//collect output here
}
catch(com.microsoft.sqlserver.jdbc.SQLServerException e)
{
patExecContext.setProcessDataStringValue("/process_data/@exceptionText", e,getMessage());
return;
}
//write results to process variables