当前位置:网站首页>Note: load the configuration file as a byte stream and get the resources in it
Note: load the configuration file as a byte stream and get the resources in it
2022-06-30 03:25:00 【Artificial intelligence cockroach】
Load the configuration file as a byte stream , And get the resources
// establish Properties object
Properties properties = new Properties();
// Gets the class loader
ClassLoader loader = BaseDao.class.getClassLoader();
// Load the resource file through the classloader as the byte input stream
InputStream in = loader.getResourceAsStream("db.properties");
try {
properties.load(in);
} catch (IOException e) {
e.printStackTrace();
}
// obtain db.properties resources
DRIVER = properties.getProperty("DRIVER");
URL = properties.getProperty("URL");
USERNAME = properties.getProperty("USERNAME");
PASSWORD = properties.getProperty("PASSWORD");
边栏推荐
- 行政路线编码 字母+数字的排序方式
- TiDB 6.0:讓 TSO 更高效丨TiDB Book Rush
- 编译一个无导入表的DLL
- Utf8 error in Oracle migration of Jincang Kingbase database
- Hudi record
- Redis中的SDS理解
- HOOK Native API
- Knowledge points of 2022 system integration project management engineer examination: software quality assurance and quality evaluation
- 产品思维 | 无人机快递的未来值得期待吗?
- Functions in C language
猜你喜欢

1148_ Makefile learning_ Targets, variables, and wildcards in makefile

F1C100S自制开发板调试过程

X书6.89版本shield-unidbg调用方式

DC/DC变换器轻载时三种工作模式的原理及优缺点

Compile a DLL without import table

The broadcast module code runs normally in autojs4.1.1, but an error is reported in pro7.0 (not resolved)

C#【高级篇】 C# 多线程

LitJson解析 生成json文件 读取json文件中的字典

The MariaDB database was found 12 hours late

Reasons for MySQL master-slave database synchronization failure
随机推荐
zabbix 触发器详解
图的邻接矩阵存储 C语言实现BFS
Stc89c52/90c516rd/89c516rd DHT11 temperature and humidity sensor drive code
Link garbled escape character
X书6.97版本shield-unidbg调用方式
JS 字母和数字的相互转换
AppData文件夹下Local,Locallow和Roaming
Data set preparation and arrangement
Utilisation de foreach en Qt
JS 互相引用的问题
MySQL extracts strings from table fields
Gulang bilibilibili Live Screen Jackie
Mysql性能优化(6):读写分离
华为面试题: 分糖果
Functions in C language
X Book 6.97 shield unidbg calling method
共124篇!墨天轮“高可用架构”干货文档分享(含Oracle、MySQL、PG)
TiDB 6.0:让 TSO 更高效丨TiDB Book Rush
Chapter 2 control structure and function (programming problem)
[ten minutes] manim installation 2022