HI,
I am reading config file form my harddisk and follwing is the code.
Code starts from here :-
import java.io.*;
import java.util.*;
public class ReadProperties
{
public Properties getProperties()
{
String FileName = "TestProperty.properties";
System.out.println("File name "+FileName);
InputStream is = getClass().getResourceAsStream(FileName);
Properties dbProps = new Properties();
try
{
dbProps.load(is);
}
catch (Exception e)
{
System.out.println("Can't read the properties file. " +e.getMessage());
dbProps =null;
}
return dbProps;
}
public static void main(String[] args)
{
ReadProperties readProperties = new ReadProperties();
Properties dbProp = readProperties.getProperties();
String userName = dbProp.getProperty("userName");
System.out.println("User name "+userName);
}
}
Code ends here .
Above code works fine.
Now the problem is this config file is lying on the other server.What should i do..??
Can anyone throw some light ...on this
(pls i don't want to use RMI or JNDI in this)