on 09-03-2007 9:51 AM
Hi all,
I always created my own connection with all the properties, loading the function an so on. But I want to use JCo in a Web application running on the webAS. So I guess there must be a way to configure the jco in visual admin, and load the jco destination/connection via JNDI. That is what I'm looking for
I was doing some research on JCo and came over a help.sap.com topic which explains the rfc provider service:
http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
Alas I don't really understand the usage.
It seems that it is used for calls from inside ABAP to a Java EJB. I'm looking for the other way round, Java calling ABAP from inside WebAS container.
cheers
Stefan
Message was edited by:
Stefan Bungert
Java Ressource Adapter (JRA) is the way to go, but to answer your question:
You can use the "Destination Service"; create a Destination of type RFC, and then use it by doing a JNDI-Lookup.
http://help.sap.com/saphelp_nw04/helpdata/en/17/d609b48ea5f748b47c0f32be265935/content.htm
DestinationService dstService = (DestinationService)
ctx.lookup(DestinationService.JNDI_KEY);
if (dstService == null)
throw new NamingException("Destination Service not available");
RFCDestination dst =
(RFCDestination) dstService.getDestination("RFC", "dst-2");
int maxPoolSize = dst.getMaxPoolSize();
long maxWaitTime = dst.getMaxWaitTime();
Properties jcoProperties = dst.getJCoProperties();
/**
Code example for establishing a direct connection
*/
JCO.Client client = JCO.createClient(jcoProperties);
client.connect();
client.ping();
client.disconnect();
Message was edited by:
Josef Flatscher
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
u cn refer to this link.its of use to u.......
/message/4050028#4050028 [original link is broken]
Regards
Bhargava
points are welcome
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefen,
As my understanding there is no way to get JCO connection using JNDI. You know the standrad way of working with JCO. But if you want to use container managed connections and with JNDI then you can use JCA which is wrapper around JCO with J2EE standard. The programming style is different from JCO but its similar to JDBC. You can refer the following documentation:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/12/5b84429069de54e10000000a155106/content.htm">JRA documentation</a>
Regards
Abhilash
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.