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

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

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

DataSource.getUrl介绍

[英]The url to connect to the database. Example: jdbc:hsqldb:database/jiradb.
[中]连接到数据库的url。示例:jdbc:hsqldb:database/jiradb

代码示例

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-orion

  1. /**
  2. * adds common details such as username, password, and url. used by both XA and non-XA
  3. * connections.
  4. */
  5. private void addCommonConnectionAttributes()
  6. {
  7. buffer.append(" username='").append(ds.getUsername()).append("' \n");
  8. buffer.append(" password='").append(ds.getPassword()).append("' \n");
  9. if (ds.getUrl() != null)
  10. {
  11. buffer.append(" url='" + ds.getUrl()).append("' \n");
  12. }
  13. buffer.append(" inactivity-timeout='30'");
  14. }

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

  1. /**
  2. * adds common details such as username, password, and url. used by both XA and non-XA
  3. * connections.
  4. */
  5. private void addCommonConnectionAttributes()
  6. {
  7. buffer.append(" username='").append(ds.getUsername()).append("' \n");
  8. buffer.append(" password='").append(ds.getPassword()).append("' \n");
  9. if (ds.getUrl() != null)
  10. {
  11. buffer.append(" url='" + ds.getUrl()).append("' \n");
  12. }
  13. buffer.append(" inactivity-timeout='30'");
  14. }

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

  1. @Override
  2. protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
  3. {
  4. propertiesMap.put("cargo.datasource.id", ds.getId());
  5. propertiesMap.put("cargo.datasource.driver", ds.getDriverClass());
  6. propertiesMap.put("cargo.datasource.url", ds.getUrl());
  7. propertiesMap.put("cargo.datasource.username", ds.getUsername());
  8. propertiesMap.put("cargo.datasource.password", ds.getPassword());
  9. propertiesMap.put("cargo.datasource.jndi", ds.getJndiLocation());
  10. propertiesMap.put("cargo.datasource.driver.classpath", getDataSourceClasspath());
  11. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

  1. @Override
  2. protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
  3. {
  4. propertiesMap.put("cargo.datasource.id", ds.getId());
  5. propertiesMap.put("cargo.datasource.driver", ds.getDriverClass());
  6. propertiesMap.put("cargo.datasource.url", ds.getUrl());
  7. propertiesMap.put("cargo.datasource.username", ds.getUsername());
  8. propertiesMap.put("cargo.datasource.password", ds.getPassword());
  9. propertiesMap.put("cargo.datasource.jndi", ds.getJndiLocation());
  10. propertiesMap.put("cargo.datasource.type", ds.getConnectionType());
  11. propertiesMap.put("cargo.datasource.transactionsupport", ds.getTransactionSupport().
  12. toString());
  13. }
  14. }

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

  1. @Override
  2. protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
  3. {
  4. propertiesMap.put("cargo.datasource.id", ds.getId());
  5. propertiesMap.put("cargo.datasource.driver", ds.getDriverClass());
  6. propertiesMap.put("cargo.datasource.url", ds.getUrl());
  7. propertiesMap.put("cargo.datasource.username", ds.getUsername());
  8. propertiesMap.put("cargo.datasource.password", ds.getPassword());
  9. propertiesMap.put("cargo.datasource.jndi", ds.getJndiLocation());
  10. propertiesMap.put("cargo.datasource.type", ds.getConnectionType());
  11. propertiesMap.put("cargo.datasource.transactionsupport", ds.getTransactionSupport().
  12. toString());
  13. }
  14. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-resin

  1. if (ds.getUrl() != null)
  2. dataSourceString.append(" <url>" + ds.getUrl() + "</url>\n");

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

  1. if (ds.getUrl() != null)
  2. dataSourceString.append(" <url>" + ds.getUrl() + "</url>\n");

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

  1. writer.println("\"/>");
  2. writer.print(" <properties ");
  3. String url = ds.getUrl();
  4. if (url != null)
  5. writer.print(ds.getUrl());
  6. writer.print("\" ");

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

  1. @Override
  2. protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
  3. {
  4. Map<String, String> datasourceProperties = new HashMap<String, String>();
  5. datasourceProperties.put("name", ds.getId());
  6. datasourceProperties.put("jndi-name", getDataSourceJndi(ds));
  7. datasourceProperties.put("driver-name", ds.getDriverClass());
  8. datasourceProperties.put("connection-url", ds.getUrl());
  9. datasourceProperties.put("user-name", ds.getUsername());
  10. datasourceProperties.put("password", ds.getPassword());
  11. if (TransactionSupport.NO_TRANSACTION.equals(ds.getTransactionSupport()))
  12. {
  13. datasourceProperties.put("jta", "false");
  14. }
  15. else
  16. {
  17. datasourceProperties.put("jta", "true");
  18. }
  19. String dsProps = mapResourceProperties(datasourceProperties);
  20. propertiesMap.put("cargo.datasource.properties", dsProps);
  21. }
  22. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-wildfly

  1. @Override
  2. protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
  3. {
  4. Map<String, String> datasourceProperties = new HashMap<String, String>();
  5. datasourceProperties.put("name", ds.getId());
  6. datasourceProperties.put("jndi-name", getDataSourceJndi(ds));
  7. datasourceProperties.put("driver-name", ds.getDriverClass());
  8. datasourceProperties.put("connection-url", ds.getUrl());
  9. datasourceProperties.put("user-name", ds.getUsername());
  10. datasourceProperties.put("password", ds.getPassword());
  11. if (TransactionSupport.NO_TRANSACTION.equals(ds.getTransactionSupport()))
  12. {
  13. datasourceProperties.put("jta", "false");
  14. }
  15. else
  16. {
  17. datasourceProperties.put("jta", "true");
  18. }
  19. String dsProps = mapResourceProperties(datasourceProperties);
  20. propertiesMap.put("cargo.datasource.properties", dsProps);
  21. }
  22. }

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

  1. sb.append(" <New class=\"com.mchange.v2.c3p0.ComboPooledDataSource\">\n");
  2. sb.append(" <Set name=\"driverClass\">" + ds.getDriverClass() + "</Set>\n");
  3. sb.append(" <Set name=\"jdbcUrl\">" + ds.getUrl() + "</Set>\n");
  4. sb.append(" <Set name=\"user\">" + ds.getUsername() + "</Set>\n");
  5. sb.append(" <Set name=\"password\">" + ds.getPassword() + "</Set>\n");

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-glassfish

  1. DataSource dataSource = new DataSource("jdbc/__default",
  2. firstDS.getConnectionType(), firstDS.getTransactionSupport(),
  3. firstDS.getDriverClass(), firstDS.getUrl(), firstDS.getUsername(),
  4. firstDS.getPassword(), "DummyCargoDefaultDS-" + firstDS.getId(),
  5. new Properties(firstDS.getConnectionProperties()));

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

  1. /**
  2. * This method converts the DataSource to a Resource.
  3. *
  4. * @param ds DataSource to convert to a resource.
  5. * @param resourceType the type of the Resource to convert to. ex.
  6. * <code>javax.sql.DataSource</code>
  7. * @param driverParameter the name of the parameter to store {@link DataSource#getDriverClass()
  8. * driverClass}.
  9. * @return a Resource representing the assignable fields of the DataSource.
  10. */
  11. public Resource convertToResource(DataSource ds, String resourceType, String driverParameter)
  12. {
  13. Properties parameters = new Properties();
  14. if (ds.getUrl() != null)
  15. {
  16. PropertyUtils.setPropertyIfNotNull(parameters, "url", ds.getUrl());
  17. }
  18. PropertyUtils.setPropertyIfNotNull(parameters, "user", ds.getUsername());
  19. PropertyUtils.setPropertyIfNotNull(parameters, "password", ds.getPassword());
  20. PropertyUtils.setPropertyIfNotNull(parameters, driverParameter, ds.getDriverClass());
  21. parameters.putAll(ds.getConnectionProperties());
  22. Resource resource = new Resource(ds.getJndiLocation(), resourceType);
  23. resource.setParameters(PropertyUtils.toMap(parameters));
  24. return resource;
  25. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-tomcat

  1. /**
  2. * This method converts the DataSource to a Resource used in Tomcat.
  3. *
  4. * @return a Resource that can be used in Tomcat.
  5. * @param ds the DataSource we are configuring.
  6. */
  7. protected Resource convertToResource(DataSource ds)
  8. {
  9. Properties parameters = new Properties();
  10. PropertyUtils.setPropertyIfNotNull(parameters, "url", ds.getUrl());
  11. PropertyUtils.setPropertyIfNotNull(parameters, "username", ds.getUsername());
  12. PropertyUtils.setPropertyIfNotNull(parameters, "password", ds.getPassword());
  13. parameters.putAll(ds.getConnectionProperties());
  14. Resource resource = new Resource(ds.getJndiLocation(), ConfigurationEntryType.DATASOURCE);
  15. PropertyUtils.setPropertyIfNotNull(parameters, "driverClassName", ds.getDriverClass());
  16. resource.setParameters(PropertyUtils.toMap(parameters));
  17. return resource;
  18. }

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

  1. /**
  2. * This method converts the DataSource to a Resource used in Tomcat.
  3. *
  4. * @return a Resource that can be used in Tomcat.
  5. * @param ds the DataSource we are configuring.
  6. */
  7. protected Resource convertToResource(DataSource ds)
  8. {
  9. Properties parameters = new Properties();
  10. PropertyUtils.setPropertyIfNotNull(parameters, "url", ds.getUrl());
  11. PropertyUtils.setPropertyIfNotNull(parameters, "username", ds.getUsername());
  12. PropertyUtils.setPropertyIfNotNull(parameters, "password", ds.getPassword());
  13. parameters.putAll(ds.getConnectionProperties());
  14. Resource resource = new Resource(ds.getJndiLocation(), ConfigurationEntryType.DATASOURCE);
  15. PropertyUtils.setPropertyIfNotNull(parameters, "driverClassName", ds.getDriverClass());
  16. resource.setParameters(PropertyUtils.toMap(parameters));
  17. return resource;
  18. }

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

  1. /**
  2. * Get a properties object containing all of the members of this datasource object. Note that
  3. * driver properties will be nested and delimited by a semicolon.
  4. *
  5. * @param data DataSource to serialize into properties.
  6. * @return a properties object corresponding to this datasource
  7. */
  8. public Properties toProperties(DataSource data)
  9. {
  10. Properties properties = new Properties();
  11. PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.JNDI_LOCATION, data
  12. .getJndiLocation());
  13. PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.CONNECTION_TYPE,
  14. data.getConnectionType());
  15. PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.TRANSACTION_SUPPORT,
  16. data.getTransactionSupport());
  17. PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.DRIVER_CLASS, data
  18. .getDriverClass());
  19. PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.URL, data.getUrl());
  20. PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.USERNAME, data
  21. .getUsername());
  22. PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.PASSWORD, data
  23. .getPassword());
  24. PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.ID, data.getId());
  25. PropertyUtils.setPropertyIfNotNull(properties,
  26. DatasourcePropertySet.CONNECTION_PROPERTIES,
  27. getConnectionPropertiesAsASemicolonDelimitedString(data));
  28. return properties;
  29. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jrun

  1. createTextContentChild(datasourceElement, "jndi-name", ds.getJndiLocation());
  2. createTextContentChild(datasourceElement, "driver", ds.getDriverClass());
  3. createTextContentChild(datasourceElement, "url", ds.getUrl());
  4. createTextContentChild(datasourceElement, "username", ds.getUsername());
  5. createTextContentChild(datasourceElement, "password", ds.getPassword());

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

  1. createTextContentChild(datasourceElement, "jndi-name", ds.getJndiLocation());
  2. createTextContentChild(datasourceElement, "driver", ds.getDriverClass());
  3. createTextContentChild(datasourceElement, "url", ds.getUrl());
  4. createTextContentChild(datasourceElement, "username", ds.getUsername());
  5. createTextContentChild(datasourceElement, "password", ds.getPassword());

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jboss

  1. getAntUtils().addTokenToFilterChain(filterChain, "url", ds.getUrl());
  2. getAntUtils().addTokenToFilterChain(filterChain, "driverClass", ds.getDriverClass());
  3. getAntUtils().addTokenToFilterChain(filterChain, "username", ds.getUsername());

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

  1. getAntUtils().addTokenToFilterChain(filterChain, "url", ds.getUrl());
  2. getAntUtils().addTokenToFilterChain(filterChain, "driverClass", ds.getDriverClass());
  3. getAntUtils().addTokenToFilterChain(filterChain, "username", ds.getUsername());

相关文章