SAP JCo: JCoDestination vs. JCoClient
Asked Answered
K

2

7

I'm calling a function in SAP system from Java with the JCo library. So far my call works, but when I look for help in the Internet, there is always a JCoClient that is being used to get the functions, making commits, etc.

But a JCoClient class does not exist in JCo 3.

Instead I use an instance of the JCoDestination that I created with a config file.

What is the difference between JCoClient and JCoDestination? And why is nobody talking about JCoDestination, but always JCoClient?

Keldon answered 24/10, 2012 at 8:4 Comment(0)
B
11

The SAP Java Connector has been completely reworked from 2 to 3 version. The old JCO.Client class has been substituted with JCoDestination, but it's not just a name change, the library architecture changed completely, so porting code from JCo 2 to JCo 3 is not just a matter of changing class names. For example, to connect to a SAP service with Jco 2 one 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 the two libraries at SAP JCo Installation. Furthermore, at SAP JCo Migration 2.x-3.0 (Standalone) there is a detailed guide for migration from 2 to 3. The latter link can also be accessed from the left side index on the former link, from which you can access information about "Client Programming SAP JCo 2.x" and "3.0".

Boyne answered 24/10, 2012 at 12:19 Comment(0)
K
3

Most of the "stuff" you'll find will implicitly refer to the old version (2.x) of the Java Connector. You can still grab that version from SAP, and I'd encourage you to do so - not to use it, but to compare the javadoc. You'll see that the class structure was changed radically between the 2.x and 3.x releases (and to the better, I'd say). However, that means that you have to re-work many of the examples because the class names have changed.

Kowalczyk answered 24/10, 2012 at 8:39 Comment(3)
So you mean JCoClient has been renamed to JCoDestination in JCo3? Compare the Javadoc? I'd like to, but the javadoc is not published :-(Keldon
It's more than just a renaming - they changed the class structure quite severely. The javadoc is part of the downloadable archive.Kowalczyk
u are so damn right! jco3 is absolutely confusing compared to jco2.Sclar

© 2022 - 2024 — McMap. All rights reserved.