Programming with JCo (SAP)

A

Armin Gajda

Hi,

I hope there is someone out there with programming experiences in SAP
over Jco.

Unfortunately I have no SAP System here to test my code with.
In the documentation is written:

------
JCO.Repository mRepository;

mRepository = new JCO.Repository("ARAsoft", mConnection);

We invoke the constructor for JCO.Repository with two parameters; the
first one is an arbitrary name, the second one either a connection pool
name or a JCO.Client object. In other words: Both connection pooling and
direct connections are supported. In (web) server applications, we
should always use a connection pool for the repository. The userid used
for the repository has to have sufficient authorizations in SAP for the
metadata access to be possible. Please read the Javadoc for class
JCO.Repository to find out which specific authorizations are required.
You can use one special userid for the repository access and one or more
"normal" userids for the actual application.
------

I have the following code I was able to test on a foreign system:


public JCO.Function getFunction(String repositoryName, String
functionName,
JCO.Client connection) {

IRepository repository =
JCO.createRepository (repositoryName, connection);

IFunctionTemplate ft = repository.getFunctionTemplate (functionName);

return ft.getFunction ();
}

To create the Repository I pass an object of type JCO.Client. I have got
this object from a pool before.

When I understand the documentation corretly I can also pass the pool to
create a Repository. Then there wouldn't be no need to handle with
JCO.Client objects.
But I can not test this and thus I want ask if someone can confirm that
this works.

And another question: Since I don't need any Client objects then, I can
not release them to the pool. Is that ok and happens implicitely, or do
I have to do something else?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top