`

java Propertity操作

    博客分类:
  • java
 
阅读更多
public class TestPropertity {
  public static void main(String[] args){
    Properties props = new Properties();
        try {
         InputStream in = new BufferedInputStream(new FileInputStream("C:\\jpa-test-persistence.properties"));
         props.load(in);
            Enumeration en = props.propertyNames();
             while (en.hasMoreElements()) {
              String key = (String) en.nextElement();
                    String Property = props.getProperty (key);
                    System.out.println(key+"="+Property);
                }
        } catch (Exception e) {
         e.printStackTrace();
        }
  }
}
 
dataSource.driverClassName = com.mysql.jdbc.Driver
dataSource.validationQuery = select 1

txn.dataSource.label = ggggggggggggg
product.dataSource.label = ggggggggggggg
stat.dataSource.label = ggggggggggggg
search.dataSource.label = ggggggggggggg
config.dataSource.label = ggggggggggggg
user.dataSource.label = ggggggggggggg
jpaPropertyMap.hibernate.dialect = org.hibernate.dialect.MySQLDialect
jpaPropertyMap.hibernate.show_sql = true
jpaPropertyMap.hibernate.hbm2ddl.auto = update
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics