Read system property in a Java class

This entry is part of the Maximo Java Development series.

Here is a small piece of Java code that can be used to retrieve a Maximo system property in Java using MxServer.getConfig() method.

Properties configData = MXServer.getMXServer().getConfig();
String prop = configData.getProperty("mxe.adminEmail");

Replace mxe.adminEmail with your property.

Read system property in a Java class

6 thoughts on “Read system property in a Java class

  1. Hello,
    Sorry about posting here.
    I want to ask if someone can help me.
    I want to sort my resultset on the start center by the difference between target finish and current date.
    Thank you

    1. Hi, Reply was very late you can create any non-persistent/persistent field on the same object and put a formula on that which calculates the difference between two dates, and then that field you can use in the query as order by.

  2. Looks like getConfig() is deprecated and you use MXServer.getMXServer().getSystemProperties().getProperty({name}) instead.

  3. You can also use:
    MXServer.getMXServer().getMxServerConfig().getProperty(“{propertyName}”);

  4. While reading property, we are using MXServer.geXServver()…….
    Do we need close the MXServer connection?

Leave a Reply to Unknown Cancel reply

Your email address will not be published. Required fields are marked *

Scroll to top