Oracle provides standard class which can be used to initialize the apps context (set policy context) in java files if required –
Class Name – PaMoInit
Method – MoInit
Location - oracle.apps.pa.webadi.utilities
Call –
PaMoInit.MoInit(paramBneWebAppsContext);
This can be simply import if we are in PA module. Please check if same exist for any other modules otherwise creates below method and register (place) at some places.
package oracle.apps.pa.webadi.utilities;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
import oracle.apps.bne.exception.BneException;
import oracle.apps.bne.framework.BneWebAppsContext;
import oracle.apps.fnd.common.VersionInfo;
public class PaMoInit
{
public static void MoInit(BneWebAppsContext paramBneWebAppsContext) throws SQLException, BneException
{
Connection localConnection = paramBneWebAppsContext.getJDBCConnection();
String str = "";
CallableStatement localCallableStatement = null;
StringBuffer localStringBuffer = new StringBuffer();
localStringBuffer.append("begin PA_MOAC_UTILS.INITIALIZE; end;");
localCallableStatement = localConnection.prepareCall(localStringBuffer.toString());
localCallableStatement.execute();
localCallableStatement.close();
}
}
No comments:
Post a Comment