code: public static Connection getConnection(final String jndiName)
              throws FactoryException {
  
          Validate.notBlank(jndiName, "The validated character sequence 'jndiName' is null or empty");
  
          // no need for defensive copies of Strings
  
          try {
              return DataSourceFactory.getDataSource(jndiName).getConnection();
          } catch (SQLException e) {
              final String error = "Error retrieving JDBC connection from JNDI: " + jndiName;
              LOG.warn(error);
              throw new FactoryException(error, e);
          }
      }
docs: Return a Connection instance for a JNDI managed JDBC connection.
  
  @param jndiName The JNDI connection name
  @return a JDBC connection
  @throws FactoryException         When the connection cannot be retrieved from JNDI
  @throws NullPointerException     When {@code jndiName} is null
  @throws IllegalArgumentException When {@code jndiName} is empty