构建没有属性文件的JCoServer [英] Building JCoServer without Properties-File

查看:197
本文介绍了构建没有属性文件的JCoServer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有另一个JCo相关的问题,希望找到帮助。

I got another JCo-related question and hopefully finding help.

使用JCo,您可以轻松地建立一个连接, JCo库。不幸的是,构建连接的唯一方法是使用创建的属性文件来处理。它不会是坏的,如果没有任何敏感的数据。但至少,SAP用户的密码位于文件中,因此在这种连接处理方式中缺乏安全性。 JCo的手册也这样说:

With JCo you can easily build up a connection like it is explained in the example sheets which came with the JCo-library. Unfortunately, the only way building a connection is handled with a created property file. It wouldn´t be that bad, if there wasn´t any sensible data in it. But at least, the password for the SAP user stands in the file, so it is a lack of safety in this way of connection-handling. The manual of JCo says so, too :

对于这个例子,目标配置存储在程序调用的文件中,实际上你应该避免安全原因。

"For this example the destination configuration is stored in a file that is called by the program. In practice you should avoid this for security reasons."

但毕竟不能找到一个有效的解决方案。有这个主题的掌握线程,像这样

but couldn´t find a working solution after all. There are a palmful threads about this theme, like this

http://forums.sdn.sap.com/thread.jspa?messageID=7303957

但不包含是有帮助的。我真的不能找出一个解决方案,也找不到一个。实际上,我解决了安全问题,删除建立连接后的文件,但这不是一个令人满意的解决方案。必须有一个更好的方式获取连接的参数,特别是当它在手册,但我没有胶水如何。

but none of them are helpful. I really can´t figure out a solution and neither find one. Actually I solved the security-problem with deleting the file after building the connection, but this is not a satisfying solution. There have to be a better way getting the parameter for the connection, especially when it stands in the manual, but I have no glue how.

任何人已经使用JCo 3.0并且知道这个问题吗?

Anybody already worked with JCo 3.0 and knows this problem?

推荐答案

是的,这是可能的。你必须创建自己的DestinationDataProvider实现,并使用Environment.registerDestinationDataProvider()注册它。但是,您的DDP获取连接数据和凭据由您决定。查看 net.sf.rcer.conn.connections.ConnectionManager ,有一个工作示例。

Yes, that's possible. You have to create your own implementation of DestinationDataProvider and register it using Environment.registerDestinationDataProvider(). However your DDP obtains the connection data and credentials is up to you. Take a look at net.sf.rcer.conn.connections.ConnectionManager, there's a working example in there.

您需要


  • 从第66行开始复制私有类,并根据自己的需要进行调整

  • 使用某些字符串获取连接(
  • )。 将传递给您的DestinationDataProvider的标识符。
  • copy the private class starting on line 66 and adapt it to your own needs (that is, fetch the connection data from wherever you want to)
  • perform the registration (line 204) somewhere during the startup of your application
  • get the connection using some string identifier that will be passed to your DestinationDataProvider.

这篇关于构建没有属性文件的JCoServer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆