Solution:
Put the druid.properties file in the SRC directory
Change to absolute path:
Properties pro =new Properties();
// InputStream is= JDBCUtils.class.getClassLoader().getResourceAsStream("src/main/druid.properties");
// pro.load(is);
pro.load(new FileReader("src/druid.properties"));
ds= DruidDataSourceFactory.createDataSource(pro);
Read More:
- Extracting JDBC tool class: JDBC utils
- [Solved] Read the resources resource and convert it to file error: java.io.filenotfoundexception
- Java database Druid error: com.alibaba.druid.pool.DruidDataSource error
- [Solved] com.alibaba.druid.filter.FilterManager : load filter error, filter not found : sl4j
- Java implementation of inputsteam to Base64
- springboot sqlserver druid reward: validateConnection false
- [Solved] POI Read excel Error: Your InputStream was neither an OLE2 stream, nor an OOXML stream
- How to Download File via Response (Example Code)
- Configuration of springboot + Druid connection pool
- [Solved] Mybatis Error: Could not find resource mybatis-conf.xml
- [Solved] shiro Error: SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.
- [Solved] Failed to load class org.slf4j.impl.StaticLoggerBinder
- [Solved] Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
- Flutter: How to Fix Android module can’t recognize flutter SDK source code
- [Solved] Could not find resource COM / atguigu / Dao / studentdao.xm, the mapper file for storing SQL statements could not be found and an error occurred
- log4j:WARN Error during default initialization [How to Solve]
- Resources is configured in the build of Maven project to prevent the failure of resource export
- Multipartfiletofileutils (multipartfile to file)
- Java Running Error: Could not find or load main class
- The Java class generated by protocol reports an error: cannot access