cancel
Showing results for 
Search instead for 
Did you mean: 

how to do connection pooling in sapjco3

0 Kudos

Hi,

Can any body help on this. How to do connection pooling in sapjco3. Actually in sapjco2 we are doing like below. We are created a common method getRepository() and we are calling this method where ever we required connection. So I just want to do the same thing using sapjco3. But when searched in google I found that you have to use DestinationDataProvider and write a custom class and pass the params in runtime. So I have few queries on this.

In sapjco2:

public IRepository getRepository(){

IRepository repository = null;

JCO.Pool pool = JCO.getClientPoolManager().getPool("TESTPOOL");

if(pool == null){

JCO.addClient("TESTPOOL",5, "500", "test123", "testpwd", "sap.dev.com"));

}

repository = JCO.createRepository("TestRepository","TESTPOOL");

return repository;

}

So in other classes wherever we required the connection we are just calling the above method like below.

IRepository repository = getRepository();

repository.getFunctinTemplate("BAPI_COMPANY_LIST");

1) How to create a same method like above using DestinationDataProvider class in sapjco3

2) Where we have to put this DestinationDataProvider class, actually my project is a maven web project which will

give you a war file, so can we add this class in the project code itself our we need to deploy as seperate entity.

3) How to pass the properties parameters runtime to the DestinationDataProvider.

jerryjanda
Community Manager
Community Manager
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers, as it provides tips for preparing questions that draw responses from our members. Feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will help you when submitting questions to the community.

Examples of how you can improve a question:

* Outline what steps you took to find answers (and why they weren't helpful).

* Share screenshots of what you've seen/done.

* Make sure you've applied the appropriate tags.

* Use the "insert code" feature correctly.

If you don't apply the correct tags, the right experts won't see your question to answer it. And if you don't insert code properly, it makes the question very difficult for members to read.

Should you wish, you can revise your question by selecting Actions, then Edit.

The more details you provide, the more likely it is that members will be able to respond.

I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

Kind regards,

--Jerry

Moderation Lead

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Nani,

JCo 3.0/3.1 has a different architecture compared to JCo 2.1 and older. In JCo 3.0/3.1 the pooling is done automatically within JCo runtime, if the destination is configured accordingly. You can check https://support.sap.com/jco#Documentation to learn more about JCo programming. Furthermore, you can check the samples included in the archive available for download.

Best regards,
Markus

Accepted Solutions (0)

Answers (0)