org.codehaus.cargo.container.configuration.entry.DataSource.setPassword()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中org.codehaus.cargo.container.configuration.entry.DataSource.setPassword()方法的一些代码示例,展示了DataSource.setPassword()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataSource.setPassword()方法的具体详情如下:
包路径:org.codehaus.cargo.container.configuration.entry.DataSource
类名称:DataSource
方法名:setPassword

DataSource.setPassword介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.cargo-test-runner/cargo-test-runner

private static DataSource getDataSource(Properties properties, String containerId)
{
  Properties serverProperties = getPropertiesForServer(properties, containerId);
  DataSource dataSource = new DataSource();
  dataSource.setJndiLocation(serverProperties.getProperty("cargo.datasource.jndi"));
  dataSource.setDriverClass(serverProperties.getProperty("cargo.datasource.driver"));
  dataSource.setUrl(serverProperties.getProperty("cargo.datasource.url"));
  dataSource.setUsername(serverProperties.getProperty("cargo.datasource.username"));
  dataSource.setPassword(serverProperties.getProperty("cargo.datasource.password"));
  return dataSource;
}

代码示例来源:origin: codehaus-cargo/cargo

/**
   * if the enclosed driver properties object is set, and also contains the user and password
   * properties, set the corresponding member values.
   */
  private void setCredentialsIfInsideDriverProperties()
  {
    if (getConnectionProperties() != null)
    {
      if (getConnectionProperties().containsKey("user"))
      {
        setUsername(getConnectionProperties().getProperty("user"));
      }

      if (getConnectionProperties().containsKey("password"))
      {
        setPassword(getConnectionProperties().getProperty("password"));
      }
    }
  }
}

相关文章