cancel
Showing results for 
Search instead for 
Did you mean: 

getting JCOConnection

Former Member
0 Kudos

Hello,

i have deploy a application on the J2EE WAS which is using JCO Connections for calling RFC.

Now i have seen that i can Maintain and create JCO Connection in WD Content Administrator.

Is it possible to access these JCO Connection by JCO Api?

thx

Mario

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hai,

If you mean JCO Connection pooloing see this link

http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/82343ecc7f892ee10000000a114084/content.htm

regards,

Naga

Former Member
0 Kudos

Hai,

Executing a RFC using APi doesn't need SLD.

See this <a href="http://www.sapdevelopment.co.uk/java/jco/jco_callfunc2.htm">Sample Program</a>

I did the same but i executed this in a bean , i used javabean model to integrate in wdp application.

regards,

Naga

Former Member
0 Kudos

Hi all,

i think i have to configure something on SLD.

@Abhijeet: I can create JCO connections by code this is not the Problem.

My Mission is to create and maintain JCO Connection in Content Administrator and not in Propertie files. So the solution WDSystemLandscape.getJCOClientConnection("Name") was the right way.

My Application is not configured in SLD as a SoftwareComponent or SoftwareProdukt

i was directly deployed to WAS could this be a reason for Nullpointer exception?

In API i see that WDSystemLandscape is "abstract", maybee there is a Factory for getting a Instance of WDSystemLandscape?

Former Member
0 Kudos

Hai,

By using SAP Enterprise Connector you can connect to R/3.

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/79/c6213e225f9a0be10000000a114084/content.htm">Click here</a>

Thanks,

Naga

Former Member
0 Kudos

Hi,

thx for your answers.

My application is deployed on XI WAS there is no SAPPortal installed. The application is a WebModule packed in a EAR file.

When i try to access the WDSystemLandscape i allways getting a NullPointerException.

Do i need SAP Portal if i want to access JCO Connections from sld, i dont think so?

PS:

JCO.createClient("parameters") works fine, but is not the best solution, because i have to store the connectionsdatas in a propertie file for administrative.

thx

Mario

abhijeet_mukkawar
Active Contributor
0 Kudos

Hi,

You dont need SAP portal for accessing JCO of SLD.

Rgarding CreateClient(), though you have stored parameter in prop, you can read them and then can pass to createClient().

let me know if you face any problem

regards

Message was edited by:

Abhijeet

Former Member
0 Kudos

Hi Mario,

You can get a JCo Connection with the following line of code:

IWDJCOClientConnection jcoClientConn = WDSystemLandscape.getJCOClientConnection(jcoName);

where jcoName is a String that's the name of the Jco Connection as defined in the Content Administrator.

Once you have that you can access all the information about that connection.

For instance, in one of my apps, I need to change what JCo connection I'm using for one of my models depending on what value they select from a radio button group. So I get the connection using the line of code above, and then set my model to use that connection with the following line:

myModel.setJcoClient(jcoClientConn.getClient());

I hope that helps some.

-Jennifer

abhijeet_mukkawar
Active Contributor
0 Kudos

Hi,

Check this out,

hope it helps

regards