Anil's Blog is Best Viewed on GOOGLE CHROME

Thursday, April 16, 2009

Callable Statement in Controller

import java.sql.CallableStatement;

import java.sql.Types;
import oracle.apps.fnd.framework.OAApplicationModule;

import oracle.apps.fnd.framework.OAException; 
import oracle.apps.fnd.framework.server.OADBTransaction; 
  
try 

{
Connection conn = (Connection)oapagecontext.getApplicationModule(oawebbean).getOADBTransaction().getJdbcConnection();

CallableStatement cs = conn.prepareCall("{call XX_UPDATE_SCO_DETAILS_PKG.SCO_ADD_ON_WORK(?,?,?,?,?,?,?)}"); 

cs.setString(1, Proj_ID);
cs.setString(2, SCOID);
cs.setString(3, Assign_ID);
cs.setString(4, "ADD_NEW_RESOURCES");
cs.setString(5, strStartDate);
cs.setString(6, strEndDate);
cs.registerOutParameter(7, Types.VARCHAR);
cs.execute();
error_mess = cs.getString(7);
if(!StringUtils.isNullOrEmpty(error_mess))
{
throw new OAException("Error in saving data in custom table OR Updating LOE: "+error_mess);
}
conn.commit();
cs.close();
}
catch (SQLException sqle)
{
throw OAException.wrapperException(sqle);
}
Debug.log(oapagecontext, this, "Callabe Statement Executed", 3);




No comments:

Post a Comment

Note: Only a member of this blog may post a comment.