Code example for DataSource

Methods: getConnection

0
        realPassword = password;
      } 
 
      if (StringUtils.isEmpty(realUser))
      { 
        final Connection connection = ds.getConnection();
        if (connection == null)
        { 
          throw new SQLException("JNDI DataSource is invalid; it returned null without throwing a meaningful error.");
        } 
        return connection;
      } 
 
      final Connection connection = ds.getConnection(realUser, realPassword);
      if (connection == null)
      { 
        throw new SQLException("JNDI DataSource is invalid; it returned null without throwing a meaningful error.");
      } 
      return connection;
    } 
    catch (DatasourceServiceException ne)