propertymgr.java
来自「基于mysql5.0完成的shopping网站后台」· Java 代码 · 共 39 行
JAVA
39 行
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package com.shopping.util;import java.io.IOException;import java.util.Properties;/** * * @author ruirui */public class PropertyMgr {private static Properties props = new Properties(); static { try { props.load(PropertyMgr.class.getClassLoader().getResourceAsStream("resoure/shopping.properties")); } catch (IOException e1) { e1.printStackTrace(); } } public static String getProps(String key) { return props.getProperty(key); } private PropertyMgr() {} //测试语句 //public static void main(String[] args){// System.out.println(getProps("dbName")); //} }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?