on 03-21-2005 1:55 PM
Hi,
i have a J2EE Engine 6.20 here and i'am developing an EJB to be published as Webservice.
Within the the Bean i use JCO to connect to the R/3:
JCO.Client client = JCO.createClient("700", "user", "password", "de", "55.55.555.5", "00" );
Now, my question:
I want to keep the parameters for <i>JCO.createClient()</i> configurable.
What's the "best practice" way this to do this? Init/Startup-Parameter in an xml?
If yes, in wich one? global-web.xml maybe?
Thanks in advance for all replies,
Christian
Hi Christian,
Since you pass the parameters to JCo inside your EJB, the "best practice" would be to declare them as environment entries in the <i>ejb-jar.xml</i>, e.g.
<env-entry>
<env-entry-name>UserName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>user</env-entry-value>
</env-entry>
Then you can simply lookup the necessary entries from the bean JNDI environment like this
InitialContext ctx = new InitialContext();
String userName = (String) ctx.lookup("java:comp/env/UserName");
and pass them to the <i>JCO.createClient()</i> method.
Hope that helps,
Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.