SDK Script PX code to get db hostname

In Script PX code, how can I get the Agile database hostname into a String?  I see there is a  PropertyConstants.PROP_DB_SERVER_HOSTNAME , but am unsure of what the code should look like to get it.

Add Comment
1 Answer(s)

Hi MrMathison,

This works for me…

 

IAgileSession session = AgileLoginCalls.connect();
IAdmin admin = session.getAdminInstance();
INode locationsNode = admin.getNode(NodeConstants.NODE_SERVER_LOCATION);
IProperty prop = locationsNode.getProperty(PropertyConstants.PROP_DB_SERVER_HOSTNAME);
System.out.println("Current Value: " + prop.getValue());

Agile Talent Answered on June 7, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.