Programming with JCo (SAP)

Discussion in 'Java' started by Armin Gajda, Aug 25, 2006.

  1. Armin Gajda

    Armin Gajda Guest

    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?

    --
    bye Armin
     
    Armin Gajda, Aug 25, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chetana.jobs
    Replies:
    0
    Views:
    564
    Chetana.jobs
    Jul 30, 2006
  2. Replies:
    1
    Views:
    523
    David
    May 3, 2007
  3. Sachin
    Replies:
    0
    Views:
    540
    Sachin
    May 21, 2007
  4. Replies:
    0
    Views:
    524
  5. ConligoSoft GmbH
    Replies:
    1
    Views:
    154
    ConligoSoft GmbH
    Apr 21, 2005
Loading...

Share This Page