on 10-21-2010 12:30 PM
Hello,
I'm developing a stand-alone Java-Application that calls RFC-programs within a SAP-system.
To test my connection I did it as written in the JCo-documentation:
Properties connectProperties = new Properties();
connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "sample.com");
connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "00");
connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "100");
connectProperties.setProperty(DestinationDataProvider.JCO_USER,"USER_ID");
connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD,"password");
connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "de");
createDestinationDataFile(DESTINATION_NAME1, connectProperties);
connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "3");
connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT,"10");
createDestinationDataFile(DESTINATION_NAME1, connectProperties);
It works, but I'd like to use the user-id and -password that is used to login to my Java application.
Thanks in advance.
Regards, Ruben
Problem solved!!!!
After nearly two days of searching I found a great Tutorial. Justclick http://www.vogella.de/articles/SAPJCo/article.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The packaged example program CustomDestinationDataProvider.java also gives a short example on how to use an own DestinationDataProvider instance.
Just two further remarks on this:
1. Don't implement the DestinationDataProvider as shown at your posted web site. You should be able to react on different destination names or at least check the destination name instead of always returning the same (static) object.
2. I recommend to use the JCoCustomDestination for adding user credentials at runtime. The DestinationDataProvider is a global instance. Otherwise your user credentials can be used by other applications in a multi-application environment. Of course, this doesn't matter with a stand-alone program.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.