JCO--API1

来源:互联网 发布:苹果4软件商店 编辑:程序博客网 时间:2024/04/27 16:57

要让JAVA程序能访问SAP系统,一般通过SAP JCO接口进行通讯,在获取到SAP的连接时需求提供一些连接参数,这些参数在最新的JCO 3.0中需要被保存到一个带有扩展名

登录配置

jco.client.lang=EN
jco.client.client=001
jco.client.passwd=xxxxxx
jco.client.user=STONE
jco.client.sysnr=00
jco.client.ashost=192.168.65.100


http://upload-images.jianshu.io/upload_images/1765749-97643b097b86c2a3.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240&_=5670223

执行sap程序的顺序---定义数据提供者(设置监听,同步更改配置文件)-----------jco操作类(读取配置文件,Environment注册提供者,加载配置文件,同步设置)  这里数据定义着就已经可以访问了

JCoDestinationManager数据操作类

---------获取destination   --------------JCoRepository-----------获取function---------execute(指定目的地,执行function)


 DestinationDataProvider

The class implements this interface to provide the properties for a client connection to a remote SAP system. Depending on the type of middleware layer loaded, the properties that need to be provided by the implementation of the DestinationDataProvider may vary.


此接口的目的是提供配置文件为客户端连接sap,通过中间件加载,就是获取propoerties,感觉老外说的话很别扭,特别简洁,难道是他们的程序员水平比我们高吗,



Environment

com.sap.conn.jco.ext.Environment
注册的DestinationDataProvider实现


JCoDestinationManager

.getDestination方法查找连接参数


JCoDestination 

identifies a physical destination of a function call. It contains all required properties in order to connect to an SAP system. Note: JCoDestination is only a configuration instance containing all necessary information for JCo runtime how create a connection. It does not creates or holds any connections by itself. JCo Runtime creates connections and caches them if defined by destination configuration.


map.remove("1") != null  ------------------map   remove会有返回值


有好多


0 0