cancel
Showing results for 
Search instead for 
Did you mean: 

Pool connection failed. Any idea why?

Former Member
0 Kudos

I'm an intern just started working with SAP JCO. I hope you'll help me out.I have read the pdf doc which comes with SAPJCO and I have the following concern/questions:

I have successfully ping the SAP system using the sample appl. which comes with JCO.I did the direct connection. But it seems to me that pool connection is complicated and a little tricky. I have been trying to connect using the pool connection but I'm stock. I got a problem at the line which says "OrderedProperties.load" The pdf hasn't elaborate on how to build a properties object. could any one please specify why this error?Below is my

sample code:

import com.sap.mw.jco.*;
public class TutorialConnect2 {

static final String POOL_NAME = "Pool";
JCO.Client mConnection;
public TutorialConnect2(){
    try {
    JCO.Pool pool = JCO.getClientPoolManager().getPool(POOL_NAME);
    if (pool == null){
      OrderedProperties logonProperties =
      OrderedProperties.load("100",/*SAP Cleint*/
       "test",/*userid*/
       "test",/*password*/
       "EN",/*language*/
       "test",/*server host name*/
       "00"
    ); 
                    
    JCO.addClientPool(POOL_NAME,/*pool name*/
   5, /*maximum number of 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[]){
    TutorialConnect2 app = new TutorialConnect2();    
    }
}

I thought the log in could be easy like direct connect. Any clue to get this straight will be appreciated. What extra do I need to do to get this connection using the pool connection work?

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

I got the connection to SAP using Pool connection. It was actually easy.It needed just some forcus and understanding. The jco pdf could have been a little more explisive on issues like this to help newbies.

Thank you all for helping out.

Former Member
0 Kudos

yes I saw this text you mentioned but there is no further discussion regarding how this properties file is created and where to save it. This is the file you're talking about:

jco.client.client=001

jco.client.user=test

jco.client.passwd=test

jco.client.ashost=testhost

jco.client.sysnr=00

I'm a newbie and ready to learn how stuff is done. I have search the web how properties file are created but I can't come up with any tutorial or so. Can I just include the login infos in side the code like in direct connect in the mconnection method? I tried that but it didn't work.? In direct connect we do some thing like this:

mConnection = JCO.createClient
("00","EMARUD","test","EN","test","00");
	mConnection.connect(

By the way I have compiled the OrderedProperties class in page 46 and it went well but when I run the programm I get this error:

java.io.IOException: Properties could not be loaded.
	at OrderedProperties.load(OrderedProperties.java:41)
	at TutorialConnect2.<init>(TutorialConnect2.java:25)
	at TutorialConnect2.main(TutorialConnect2.java:43)

Which is ok because I haven't created and put the properties file where I should. Any infos on how to create and where to place this properties file will be appreciated. Thanks!

Former Member
0 Kudos

Hi there,

open the pdf-file with page 15, look for:

In this case, we have chosen to use a

Properties object, created from a file using a utility class called OrderedProperties (a subclass of Properties, see Appendix B for the complete source code). Any other way of creating a Properties object could have been used instead.

That code can be found on page 46.

Good luck with JCO

Br. Jari S