on 03-14-2007 10:33 AM
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;
}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it seems it get some information from file /xxxxxx/xxx.properties
and get companyCode from this information and set it to the value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.