cancel
Showing results for 
Search instead for 
Did you mean: 

jco RFC Provider Service

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

I get along with standard JCo.

I want to know how to use it the ninja way...

getting the connection from the container configured in visual admin... that must be possible

cheers

stefan

former_member182294
Active Contributor
0 Kudos

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