Suppose in your DB2 you have your User Defined Function/Stored Procedure "my_function1" defined which takes one VARCHAR parameter as an input and returns VARCHAR as an output. Then to show that as some text field - you could use this technique ("db2demo" is my connection definition):
var query = "select my_function1('OpenNTF') as col1 from sysibm.dual";
var resultSet = @JdbcExecuteQuery("db2demo", query);
var text = null;
if (resultSet.next()) {
text = resultSet.getString("col1");
}
return text;}
]]>
Please let me know if that clarifies your initial question.