cancel
Showing results for 
Search instead for 
Did you mean: 

Get DBServer Name of MDM

Former Member
0 Kudos

Hi all,

I'm using connection pooling to connect to the MDM server from my Java APIs.

Is there any method which will help me to get the name of the DBServer name of the MDM repository? or should i hard code this value? This is to establish a Respository Object which takes in the parameters - Repository Name, DBServer Name, DBMS.Type.

ANy hints??

Regards,

Ak.

PS: Good Posts will be Rewarded properly.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

could you let me know, which version of MDM you are using,

Java API's will vary from Sp4 to SP5.

for sp5:

Hi find the following code.

<u>use the following line of code to get the DBMS Server Name</u>

DBMSType.MS_SQL.getName()

<u>To get DBMS TYPE</u>

DBMSType dbmsType =

DBMSType.getDBMSType(DBMSType.MS_SQL.getName());

hope this may help you,

Regards,

srinivas

Former Member
0 Kudos

Hi Srinivas,

Thanks for your reply. I'm using SP5.

DBMSType.ORCL.getName()

And the code you gave me returns a string called ORCL for oracle. This is not what i want. I want to get the SID of my MDM Database Server.

I give that parameter in the following code.

RepositoryIdentifier repId = new RepositoryIdentifier ("Vendor", "MDS", DBMSType.ORACLE);

here Vendor is the Repository. MDS is the dbserver name. and the DB Type is Oracle.

Can you help me get the value of the DBServer name "MDS" through code?

Regards,

Ak.

Former Member
0 Kudos

Hi AK,

Try this code below

GetDBMSListCommand dbmslist = new GetDBMSListCommand(<i><connection></i>);

dbmslist.setSession(<i><server session></i>);

dbmslist.execute();

DBMSProperties[] dbProp = dbmslist.getDBMSList();

dbProp[0 or 1..n].getgetName();

Hope this helps,

Vijay

Former Member
0 Kudos

Hi Vijay,

I Tried the following code.


CreateServerSessionCommand serSess = new CreateServerSessionCommand(cp);
		try {
			serSess.execute();
			
		} catch (CommandException e) {
			e.printStackTrace();
		}
		System.out.println(serSess.getSession());
		GetDBMSListCommand dbmslist = new GetDBMSListCommand(cp);
		dbmslist.setSession(serSess.getSession());
		try {
			dbmslist.execute();
		} catch (CommandException e1) {
			e1.printStackTrace();
		}
		
		DBMSProperties[] dbProp = dbmslist.getDBMSList();
//		dbProp[0 or 1..n].getgetName();
		for(int i=0; i<dbProp.length ; i++){
			System.out.println(dbProp<i>.getName());
		}

I got the following error message.

Caused by: com.sap.mdm.internal.protocol.manual.ServerException: The current Protocol operation is not supported for the session specified.

at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:112)

at com.sap.mdm.server.commands.GetDBMSListCommand.execute(GetDBMSListCommand.java:60)

... 1 more

Is there anything that i'm missing?

Regards,

Ak.

Former Member
0 Kudos

Hi Arun,

where you able to solve your problem.

Thanks and Regards,

Antony

Answers (0)