cancel
Showing results for 
Search instead for 
Did you mean: 

How t o Create connection Pooling FOR JCO

Former Member
0 Kudos

hi,

Can u pls tell me how to create connectionpooling for JCO.

regards

Guru

Accepted Solutions (1)

Accepted Solutions (1)

guillaume-hrc
Active Contributor
0 Kudos

Hi,

There is a tutorial in PDF format with the JCo itself in the Service Market place.

By the way, I found this link :

http://searchsap.techtarget.com/cgi-bin/rd.pl/ftID-949745-ctID-886901?//tip/0,289483,sid21_gci886901...

Best regards,

Guillaume

Answers (1)

Answers (1)

Former Member
0 Kudos

Guru

Here is the sample program:

***********************************************

import com.sap.mw.jco.*;

public class Connect2 extends Object {

<b>static final String POOL_NAME = "Pool";</b>

JCO.Client mConnection;

public Connect2() {

try {

<b>JCO.Pool pool = JCO.getClientPoolManager().getPool(POOL_NAME);</b>

if (pool == null) {

OrderedProperties logonProperties =

OrderedProperties.load("/logon.properties");

JCO.addClientPool(POOL_NAME, // pool name

5, // maximum number connections

logonProperties); // properties

}

mConnection = JCO.getClient(POOL_NAME);

System.out.println(mConnection.getAttributes());

}

catch (Exception ex) {

ex.printStackTrace();

}

finally {

JCO.releaseClient(mConnection);

}

}

public static void main (String args[]) {

Connect2 app = new Connect2();

}

}

**********************

<b>Documentation is here :</b> <a href="http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5c6a85b11d6b28500508b5d5211/frameset.htm"><b>JCO Document</b></a>

Thanks

Jack

<b>Allot points if my post helps!!!!</b>

Message was edited by: Jack