Here is a example:
import java.util.*;
    InputStream is = getClass().getResourceAsStream("/db.properties");
    Properties dbProps = new Properties();
    try
    {
      dbProps.load(is);
    }
    catch(Exception e)
    {
      System.err.println
        ("Can't read the properties file. " + "Make sure db.properties is in the CLASSPATH: \"/\"");
      return;
    }
    String logFile = dbProps.getProperty("logfile","DBConnectionManager.log");
    try
    {
      log = new PrintWriter(new FileWriter(logFile, true), true);
    }
    catch(Exception e)
    {
      System.err.println("Can't open the log file: " + logFile);
      log = new PrintWriter(System.err);
    }
OK, this is a clip of the DBConnectionManager.java, OK you can refer to this package.