code: public DataSource getDataSource() {
          if(dataSource == null) {
              LOG.info("Having to construct a new DataSource");
  
              dataSource = new DataSource();
  
              dataSource.setDriverClassName(dbSettings.getDriver());
              dataSource.setUrl(dbSettings.getJdbcUrl());
              dataSource.setUsername(dbSettings.getUser());
              dataSource.setPassword(dbSettings.getPass());
  
              dataSource.setMaxActive(dbSettings.getMaxActive());
              dataSource.setMaxIdle(dbSettings.getMaxIdle());
              dataSource.setMinIdle(dbSettings.getMinIdle());
              dataSource.setInitialSize(dbSettings.getInitialSize());
              dataSource.setTestOnBorrow(dbSettings.getTestOnBorrow());
              dataSource.setTestOnReturn(dbSettings.getTestOnReturn());
              dataSource.setTestWhileIdle(dbSettings.getTestWhileIdle());
              dataSource.setValidationQuery(dbSettings.getValidationQuery());
              dataSource.setLogValidationErrors(dbSettings.getLogValidationErrors());
  
              // a catch-all for any other properties that are needed
              dataSource.setDbProperties(dbSettings.getProperties());
          }
  
          return dataSource;
      }
docs: Gets a {@link DataSource} constructing a new one if needed.
  @return a {@link DataSource}.