Skip to Content

Connection Parameters

Hi All,

I am developing an EJB wherein i make a connection to SAP system. My requirement is where should i save these connections parameters.

1. i dont want to hardcode them.

2. If the user wants to change the connection parameters in future he/she should be able to do that without any problems.

Is there some way i can store the values in the Configuartion Adapter service in VA and access them from EJB.

Please give your suggestions.

Regards

Sidharth

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 31, 2005 at 01:56 PM

    HI Sid,

    There are two ways in which you can achieve your requirement.In both the cases , you have to store all your Conn params in a properties file.So later on, you can change the param values at later point of time.

    1)<b>properties file inside your project </b>.

    -- create the properties file (say <b>SAPConn.properties</b>) file inside the project package like,<b>com.yourclient.SAPmodule.util</b>

    -- Access the values in the follwoing way

    ResourceBundle rsBd = ResourceBundle.getBundle("com.yourclient.SAPmodule.util.SAPConn",

    Locale.getDefault(),this.getClass().getClassLoader());

    String name = rsBd.getString("KeyName");

    The demerit in this case is, when ever you want to change the SAP Connection parameters, you have to open up your project & then do the changes in the properties file.Then rebuild project & re deploy it on the server.

    2)<b>properties file on the SERVER </b>.

    -- create the properties file (say <b>SAPConn.properties</b>) on the server, & put it inside the <b>SERVER0</b> folder of your WAS server.

    -- Access the values in the follwoing way

    ResourceBundle rsBd = ResourceBundle.getBundle("SAPConn",

    Locale.getDefault(),this.getClass().getClassLoader());

    String name = rsBd.getString("KeyName");

    In this case, you do not have to open up your project each time you do some changes in the SAP Conn params.Just change the param values in the properties file.Rest will be taken care by the Applicaion.

    Hope this will help you.Do remember to give points in that case.

    Regards,

    Sandip Agarwal

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.