public class CreateHbaseTableDemo {
public static void main(String[] args) {
ResourceBundle resourceBundle= ResourceBundle.getBundle("hbase.properties");
String port = resourceBundle.getString("zookeeperPort");
String threadMax = resourceBundle.getString("threadMax");
String keyValueMaxSize = resourceBundle.getString("KeyValueMaxSize");
System.out.println(port);
System.out.println(threadMax);
System.out.println(keyValueMaxSize);
}
}
springboot方式
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
/**
* @Auther: admin
* @Date: 2020/6/3 20:16
* @Description: 读取自定义配置文件 properties配置文件
*/
public class ResourceUtils {
public static final String CONTEX = "test";
private static ResourceBundle resourceBundle = null;
private static Map cache = new HashMap(16);
static {


237

被折叠的 条评论
为什么被折叠?



