on 02-05-2007 10:33 AM
Hello
I'm planning to use MDM 5.5 Java API to get data from MDM Server.
I've read several blos below.
/people/udi.katz/blog/2005/07/17/mdm-connectivity-to-java-application
/people/andreas.seifried/blog/2006/03/26/performing-free-form-searches-with-mdm-java-api
/people/udi.katz/blog/2005/08/21/retrieving-data-from-mdm-server-using-the-mdm-java-api
/people/walter.kahn/blog/2005/10/27/mdm-55-api-tips-and-tricks--measurement-fields
But I'm still confused about which way I shoud chose to connect with servers.
Some blog showed the codes for connceting
-
catalogData.Login(SERVER, PORT, USER, PASSWORD, REGION_TAG, MIN_CONNECTIONS, MAX_CONNECTIONS,TIMEOUT,LOG_FILE);
System.out.println("Catalog logged in.");
measurementManager = catalogData.GetMeasurements();
-
The others showd below
-
//get the context
Context ctx = new InitialContext();
//lookup in the JDNI to get the connection factory class
IConnectionFactory connectionFactory =
(IConnectionFactory)ctx.lookup("deployedAdapters/MDMEFactory/shareable/MDMEFactory");
//Get Connction Spec to set connection properties
IConnectionSpec spec = connectionFactory.getConnectionSpec();
//Set Connection Properties
spec.setPropertyValue("UserName",USER);
spec.setPropertyValue("Password",PASSWORD);
spec.setPropertyValue("Server",SERVER);
spec.setPropertyValue("Port",PORT);
spec.setPropertyValue("RepositoryLanguage",REGION_TAG);
//Get the Connection
IConnection connection = connectionFactory.getConnectionEx(spec);
//Retrieve Native interface
INative nativeInterface = connection.retrieveNative();
//Get the CatalogData the physical connection
catalogData = (CatalogData) nativeInterface.getNative(CatalogData.class.getName());
-
I don't know which way(APIs) I should chose.
Would you let me knouw and explain about these APIs.
Regards.
Koji
You will use second snippet if your application runs within NW WebAS context (either in Portal/WebDynpro or an EJB) and use the first method if your application is not based on any of them, meaning, a standalone java application or a web application on non SAP AS.
HTH
--
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.