SAP JCo: JCoDestination vs JCoClient

I call a function in SAP from Java using the JCo library. While my call is working, but when I look for help on the Internet, there is always a JCoClient that is used to receive functions, commit commits, etc.

But the JCoClient class does not exist in JCO 3.

Instead, I am using the JCoDestination instance that I created using the configuration file.

What is the difference between JCoClient and JCoDestination? And why no one talks about JCoDestination, but always JCoClient?

+7
source share
2 answers

Context SAP Java has been completely redesigned from 2 to 3 versions. The old JCO.Client class was replaced by JCoDestination, but this is not just a name change, the library architecture has completely changed, so moving the code from JCo 2 to JCo 3 is not just changing the class names. For example, to connect to the SAP service with Jco 2, you had to write something like this:

JCO.Client client = JCO.createClient (...);

client.connect ();

whereas with JCo 3 you have:

 JCoDestination destination = JCoDestinationManager.getDestination(serviceName); 

You can find information about these two libraries in this URL . In addition, this link has a detailed guide on the transition from 2 to 3. The last link is also available from the left side index to the former link, from which you can access client programming information in both versions.

+9
source

Most of the β€œthings” you find will implicitly reference the old version (2.x) of the Java connector. You can still take this version from SAP , and I would recommend that you do this - do not use it, but compare javadoc, you will see that the class structure has changed radically between versions 2.x and 3.x (and for the better, I would said). However, this means that you will have to rework many examples because the class names have changed.

+3
source

All Articles