I have a list of environment specific properties in a config.properties file which is in a resources folder. I then have a seperate Class called GetDatabase.java which I want to grab values from the config file. File structure is below.

```
├───main
│   ├───java
│   └───resources
│
└───test
    ├───java
    │   ├───Database
    │          GetDatabase.java
    │
    └───Resources
        │
        ├───resources
               config.properties

```

My config file entries look like this:

```
dev1URL=https://mos-dev.1.com
dev2URL=https://mos-dev.2.com
dev3URL=https://mos-dev.3.com

```

In my GetDatabase class I have written some code using the getProperty method to call the property file but it's returning as null. Am I missing something here?

Below is the GetDatabase class:

```
package Database;

import java.sql.*;
import java.util.Properties;

public class GetDatabase {

{
    final ClassLoader loader = getClass().getClassLoader();
    try {
        try (InputStream config = loader.getResourceAsStream("config.properties")) {
            properties.load(config);

        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}

    public ResultSet runQuery(String strQuery) throws SQLException {

        String driver = properties.getProperty("dev1URL");
        System.out.println("db driver string is here " + driver);

```