private static void validateAndBindDataSource(Context context, String jndiName,
      DataSource dataSource, List<ConfigProperty> props)
      throws NamingException, DataSourceCreateException {
    try (Connection connection = getConnection(dataSource, props)) {
    } catch (SQLException sqlEx) {
      closeDataSource(dataSource);
      logger.warn("Failed DataSource validation for JNDI name {}", jndiName, sqlEx);
      throw new DataSourceCreateException(
          "Failed to connect to \"" + jndiName + "\". See log for details", sqlEx);
    }
    context.rebind("java:/" + jndiName, dataSource);
    dataSourceMap.put(jndiName, dataSource);
    if (logger.isDebugEnabled()) {
      logger.debug("Bound java:/" + jndiName + " to Context");
    }
  }
Binds a single Datasource to the existing JNDI tree. The JNDI tree may be The Datasource
properties are contained in the map. The Datasource implementation class is populated based on
properties in the map.

@param map contains Datasource configuration properties.
geode-core/src/main/java/org/apache/geode/internal/jndi/JNDIInvoker.java