on 07-29-2005 9:41 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.