h.mandle (Customer) to rsaSFDCadmin (RSA): asked a question.

Form or Field Validation.
Hello,

is there way to fetch details from one of the table (either user / group)
using JSP page without having database credentials in it. I have seen in past
where developers put username and password of DB user in JSP, but don't think
so that's right way to do. is there any newer way to do so? can someone list
all steps.

P.S : I am looking to develop it on 7.5.2 P03.

  • Hi,


    Check the bellow snippet utilizing the PersistenceManager class.





    <%@page import="java.sql.*"%>
    <%@ page import="com.aveksa.server.db.PersistenceManager" %>

    <%
    ResultSet result = null;
    PersistenceManager PersistenceManagerX = new PersistenceManager();

    result = PersistenceManagerX.executeJDBCQuery("Select 1 as test_column_result", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,null);

    result.next();
    String testColumnResult = result.getString(1);

    //crucial to commit-end each transaction after initiation . Without this line, sooner or later at PROD traffic level, the environment will go down with all db transactions not commited.
    PersistenceManagerX.commitTransaction();








    //transaction cleanups before JSP execution finishes

    while (PersistenceManagerX.getTransactionCount() !=0){
    System.out.println("TRANSACTION COUNT: "+PersistenceManagerX.getTransactionCount());
    PersistenceManagerX.commitTransaction();
    System.out.println("TRANSACTION COUNT: "+PersistenceManagerX.getTransactionCount());
    PersistenceManagerX.cleanTransaction();

    }

    %>





    Check the bellow implementation of another dashboard utilizing such class (JSP
    as attachment at the end of the page), to get more grip on what's going on:
    <
    https://community.rsa.com/t5/securid-governance-lifecycle/rsa-igl-recipes-
    risk-analytics-dashboard/ta-p/572008>






    Please keep in mind that the JSP is your own responsibility to maintain across
    time, as some of the classes mentioned here might or might not get updated,
    where changes will need to take place. Support won't be there break-fix such
    issues.
    Expand Post
    Selected as Best
  • Hi,


    Check the bellow snippet utilizing the PersistenceManager class.





    <%@page import="java.sql.*"%>
    <%@ page import="com.aveksa.server.db.PersistenceManager" %>

    <%
    ResultSet result = null;
    PersistenceManager PersistenceManagerX = new PersistenceManager();

    result = PersistenceManagerX.executeJDBCQuery("Select 1 as test_column_result", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,null);

    result.next();
    String testColumnResult = result.getString(1);

    //crucial to commit-end each transaction after initiation . Without this line, sooner or later at PROD traffic level, the environment will go down with all db transactions not commited.
    PersistenceManagerX.commitTransaction();








    //transaction cleanups before JSP execution finishes

    while (PersistenceManagerX.getTransactionCount() !=0){
    System.out.println("TRANSACTION COUNT: "+PersistenceManagerX.getTransactionCount());
    PersistenceManagerX.commitTransaction();
    System.out.println("TRANSACTION COUNT: "+PersistenceManagerX.getTransactionCount());
    PersistenceManagerX.cleanTransaction();

    }

    %>





    Check the bellow implementation of another dashboard utilizing such class (JSP
    as attachment at the end of the page), to get more grip on what's going on:
    <
    https://community.rsa.com/t5/securid-governance-lifecycle/rsa-igl-recipes-
    risk-analytics-dashboard/ta-p/572008>






    Please keep in mind that the JSP is your own responsibility to maintain across
    time, as some of the classes mentioned here might or might not get updated,
    where changes will need to take place. Support won't be there break-fix such
    issues.
    Expand Post
    Selected as Best