What is oadbtransaction in oaf
OADBTransaction in oaf is used perform data base operations in the OAF page controller. If we want to execute sql statements in the OAF page controller then we should create the handle of OADBTransaction and with this handle we can able to execute the sql statement in the OAF page. In the similar way , if we want to execute the PLSQL block or database procedures or function in the OAF page then we still need to use this OADBTransaction object of OA framework. Here below we will explain full What is oadbtransaction in oaf and we uses in OAF Controllers.
TO used OADBTransaction we first need to import its class in the oaf page controller to used in the controller class file.
here below is the import class of OADBTransaction.
import oracle.apps.fnd.framework.server.OADBTransaction;
Example of using oadbtransaction in oaf
Number rptHdrId;
rptHdrId = new Number(paramOAPageContext.getDecryptedParameter("ReportHeaderId"));
if (rptHdrId!=null)
Connection conn = paramOAPageContext.getApplicationModule(paramOAWebBean).getOADBTransaction().getJdbcConnection();
String Query = "SELECT NVL(expense_status_code,'NEW') status FROM ap_expense_report_headers_all WHERE report_header_id=TO_NUMBER(:1)";
String RptHdrId = ""+rptHdrId;
stmt.setString(1,RptHdrId);
for(ResultSet resultset = stmt.executeQuery(); resultset.next();)
{
result = resultset.getString("status");
paramOAPageContext.writeDiagnostics(this, "comparison"+comparison,2);
{
Here below I will write the code to perform some action if we found expense report status ‘Rejected’
}
}
What is oadbtransaction in oaf
0 comments:
Post a Comment