# import java.io.InputStream;  
# import java.util.Enumeration;  
# import java.util.Properties;  
#   
# public class PropertiesTest {  
#   
#     public static void readProperties(String fileName) {  
#         try {  
#             Properties props = new Properties();  
#   
#             /* 
#              String fileName1 = "src/util/oracle.properties"; 
#              BufferedInputStream bis = new BufferedInputStream( 
#              new FileInputStream(fileName));*/  
#   
#             // String fileName = "oracle.properties";  
#             InputStream in = PropertiesTest.class.getResourceAsStream(fileName);  
#   
#             props.load(in);  
#             Enumeration enu = props.propertyNames();  
#             while (enu.hasMoreElements()) {  
#                 String key = (String) enu.nextElement();  
#                 String property = props.getProperty(key);  
#                 System.out.println(key + "=" + property);  
#             }  
#         } catch (Exception e) {  
#             e.printStackTrace();  
#         }  
#     }  
#   
#     public static void main(String[] args) {  
#   
#         String fileName = "oracle.properties";  
#         readProperties(fileName);  
#   
#     }  
# }




Java如何遍历Map的所有的元素


http://lehsyh.iteye.com/blog/607481



java读取配置文件的几种方法


http://lehsyh.iteye.com/blog/637446