Skip to Content
avatar image
Former Member

please explain the user defined fuction

please explain this userdefined fuction

String value = "";

try {

Properties _propSet = new Properties();

_propSet.load(new FileInputStream("/xxxxxx/xxx.properties"));

value = _propSet.getProperty(companyCode);

}catch(Exception e) {value = e.toString(); }

return value;

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Mar 14, 2007 at 10:57 AM

    it seems it get some information from file /xxxxxx/xxx.properties

    and get companyCode from this information and set it to the value

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14, 2007 at 10:57 AM

    Hi Sridhar,

    The UDF is simply reading a a Property file from File system and retrieves a value for a property called "CompanyCode" and maps to a target field.

    Ideally your Property will have Name & Value pairs like this..

    XXX.Properties

    -


    CompanyCode=AB12

    BillTo=BC22

    ...etc

    Regards,

    Ananth

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 14, 2007 at 11:03 AM

    Sridhar,

    wht this UDF does is to read "property file" which is preseted in ("/xxxxxx/xxx.) this location .

    this file as value for companyCode which are assiging it to value field and passing it to output.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 14, 2007 at 11:11 AM

    Hi Sridhar,

    it creates a Properties object variable _propSet.......

    then it loads the data of /xxxxxx/xxx.properties file by opening /xxxxxx/xxx.properties file by FileInputStream class in _propSet variable..

    then it assigns value variable the data of CompanyCode which it has loaded from the above file from the _propSet object's getProperty function.....

    if some error happens in either opening the above file or getting companycode data, then an exception is thrown which is caught in catch block and then the error msg is set in value variable.

    Then value variable is returned.

    Hope this clears this UDF to you.

    Thanks,

    Rajeev Gupta

    Add comment
    10|10000 characters needed characters exceeded