Skip to Content
0
Apr 21, 2010 at 08:30 AM

JCo connection from portal JCo destination

56 Views

Hello everybody!

In a WebService, we need to fetch data from a JCo connection to a backend ERP system. Until now, we retrieved the credentials for the connection in a plain text file on the J2EE server, but we'd like to switch to using an already defined portal JCo destination (WD_MODELDATA_DEST). Since I'd like to reuse most of my current code, I don't want to create a model, instead I just want to retrieve either the JCO.Client or it's credentials from the portal JCo Destination.

Currently, I'm just doing

JCO.Client client = JCO.createClient(client, user, password, language, server, system, group);
client.connect();

What I'd like to do is something like

InitialContext context = new InitialContext();
DataSource source = (DataSource)context.lookup("myPortalJCoDestinationName");
JCO.Client client = source.getClient();
client.connect();

Where can I find information about how to implement his ?

Thanks

Michael