This discussion is archived
2 Replies Latest reply: May 1, 2012 8:46 PM by Adnan.Salim RSS

How to connect Database from Standalone Custom JSP

928482 Newbie
Currently Being Moderated

I have a requirement to invoke JSP page before AppsLocalLogin.jsp page. From my standalone custom JSP page, I have to connect the database and get some information and based on the information retrieved, redirection will happen. But I am not able to connect to database from custom JSP.

Could anybody please help me on that??

  • 1. Re: How to connect Database from Standalone Custom JSP
    Peddi Journeyer
    Currently Being Moderated
    Try below code to access one of the manager self-service function in HRMS.
    We are creating Appscontext etc
    May be below code is useful for you.


    <%@ page language="java" errorPage="OAErrorPage.jsp" contentType="text/html"
    import = ""
    import = "oracle.apps.fnd.framework.webui.OAJSPHelper"
    import = "oracle.apps.fnd.framework.webui.URLMgr"
    import = "oracle.apps.fnd.common.WebAppsContext"%>
    <%! public static final String RCS_ID = "$Header: test_fwktutorial.jsp 115.5 2003/05/05 10:20:28 gmallesh noship $"; %>
    <jsp:useBean id="sessionBean" class="oracle.apps.fnd.framework.CreateIcxSession"
    response.setHeader("Cache-Control", "no-cache"); // HTTP 1.1
    response.setHeader("Pragma", "no-cache"); // HTTP 1.0
    response.setDateHeader("Expires", -1); // Prevent caching at the proxy server
    response.setStatus(HttpServletResponse.SC_RESET_CONTENT); // HTTP 1.1. Only way to force refresh in IE.

    // There are 2 ways you can specify connection information.
    // === OPTION 1 ===
    // Obtain the Runtime Connection directly from the Project Settings.
    // String dbcFullPathName = OAJSPHelper.getWebAppContextInitParameter(pageContext, "DBC_FULL_PATH_NAME");
    // String userName = OAJSPHelper.getWebAppContextInitParameter(pageContext, "OA_LOGIN_USERNAME");
    // String userPassword = OAJSPHelper.getWebAppContextInitParameter(pageContext, "OA_LOGIN_PASSWORD");
    // String appShortName = OAJSPHelper.getWebAppContextInitParameter(pageContext, "OA_RESPONSIBILITY_APPS_SHORT_NAME");
    // String responsibilityKey = OAJSPHelper.getWebAppContextInitParameter(pageContext, "OA_RESPONSIBILITY_KEY");
    // String dbcName = dbcFullPathName.substring(dbcFullPathName.lastIndexOf(File.separatorChar)+1);
    // dbcName = dbcName.substring(0, dbcName.lastIndexOf('.'));
    // NOTE: This option will not work under Apache/JServ. In order to run under Apache/JServ
    // you will need to hard code t
    // === OPTION 2 ===Boolean.TRUE
    // Hardcode the Runtime Connection values, thus bypassing or overriding the
    // Runtime Connection values from the Project Settings. This is the old
    // way of specifying the Runtime Connection values.
    // String dbcName = "<dbhost>_<dbname>";
    // String userName = "<username>";
    // String userPassword = "<userpassword>";
    // String appShortName = "<applicationshortname>";
    // String responsibilityKey = "<responsibility>";
    String dbcFullPathName = oracle.apps.fnd.framework.webui.OAJSPHelper.getWebAppContextInitParameter(pageContext, "DBC_FULL_PATH_NAME");
    String userName = "user_name";
    String userPassword = "password";
    String appShortName = "PER";
    String responsibilityKey = "RESPONSIBILITY_SHORT_CODE";
    String dbcName = "DB SID";

    String sessionid = sessionBean.createSession(request, response, dbcFullPathName, userName, userPassword, appShortName, responsibilityKey);
    String transactionid = sessionBean.createTransaction(sessionBean.mRespInfo[0], sessionBean.mRespInfo[1], sessionBean.mRespInfo[2], dbcFullPathName);
    WebAppsContext wctx = sessionBean.getWebAppsContext();
    <title>Test International Mobility</title>
    <script language="JavaScript">
    document.cookie = "OADiagnostic=0";
    document.cookie = "OADeveloperMode=0";
    document.cookie = "OABackButtonTestMode=0";
    document.cookie = "OAPassivationTestMode=0";
    document.cookie = "OADumpUIXTree=0";
    Responsibility set for this JSP is
    and DBC is
    <a href="<%=URLMgr.processOutgoingURL("OA.jsp?akRegionCode=HR_PERSON_TREE_TOP_SS&akRegionApplicationId=800&pCalledFrom=HR_ALLOCATED_CHECKLIST_SS&pDestination=HR_ACTIONS_SS&pManagerEnabled=N&addBreadCrumb=Y" + dbcName, wctx) %>">Allocated CheckList - Manager</a>
  • 2. Re: How to connect Database from Standalone Custom JSP
    Adnan.Salim Newbie
    Currently Being Moderated

    Build a self-secure page. Add a responsibility and add that responsibility in Guest User give the page URL in your custom JSP Page and on the basis of parameter in OAF Page process request event you may do the redirection.



  • Correct Answers - 10 points
  • Helpful Answers - 5 points