本文整理了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
[英]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
/**
* adds common details such as username, password, and url. used by both XA and non-XA
* connections.
*/
private void addCommonConnectionAttributes()
{
buffer.append(" username='").append(ds.getUsername()).append("' \n");
buffer.append(" password='").append(ds.getPassword()).append("' \n");
if (ds.getUrl() != null)
{
buffer.append(" url='" + ds.getUrl()).append("' \n");
}
buffer.append(" inactivity-timeout='30'");
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* adds common details such as username, password, and url. used by both XA and non-XA
* connections.
*/
private void addCommonConnectionAttributes()
{
buffer.append(" username='").append(ds.getUsername()).append("' \n");
buffer.append(" password='").append(ds.getPassword()).append("' \n");
if (ds.getUrl() != null)
{
buffer.append(" url='" + ds.getUrl()).append("' \n");
}
buffer.append(" inactivity-timeout='30'");
}
代码示例来源:origin: codehaus-cargo/cargo
@Override
protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
{
propertiesMap.put("cargo.datasource.id", ds.getId());
propertiesMap.put("cargo.datasource.driver", ds.getDriverClass());
propertiesMap.put("cargo.datasource.url", ds.getUrl());
propertiesMap.put("cargo.datasource.username", ds.getUsername());
propertiesMap.put("cargo.datasource.password", ds.getPassword());
propertiesMap.put("cargo.datasource.jndi", ds.getJndiLocation());
propertiesMap.put("cargo.datasource.driver.classpath", getDataSourceClasspath());
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic
@Override
protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
{
propertiesMap.put("cargo.datasource.id", ds.getId());
propertiesMap.put("cargo.datasource.driver", ds.getDriverClass());
propertiesMap.put("cargo.datasource.url", ds.getUrl());
propertiesMap.put("cargo.datasource.username", ds.getUsername());
propertiesMap.put("cargo.datasource.password", ds.getPassword());
propertiesMap.put("cargo.datasource.jndi", ds.getJndiLocation());
propertiesMap.put("cargo.datasource.type", ds.getConnectionType());
propertiesMap.put("cargo.datasource.transactionsupport", ds.getTransactionSupport().
toString());
}
}
代码示例来源:origin: codehaus-cargo/cargo
@Override
protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
{
propertiesMap.put("cargo.datasource.id", ds.getId());
propertiesMap.put("cargo.datasource.driver", ds.getDriverClass());
propertiesMap.put("cargo.datasource.url", ds.getUrl());
propertiesMap.put("cargo.datasource.username", ds.getUsername());
propertiesMap.put("cargo.datasource.password", ds.getPassword());
propertiesMap.put("cargo.datasource.jndi", ds.getJndiLocation());
propertiesMap.put("cargo.datasource.type", ds.getConnectionType());
propertiesMap.put("cargo.datasource.transactionsupport", ds.getTransactionSupport().
toString());
}
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-resin
if (ds.getUrl() != null)
dataSourceString.append(" <url>" + ds.getUrl() + "</url>\n");
代码示例来源:origin: codehaus-cargo/cargo
if (ds.getUrl() != null)
dataSourceString.append(" <url>" + ds.getUrl() + "</url>\n");
代码示例来源:origin: codehaus-cargo/cargo
writer.println("\"/>");
writer.print(" <properties ");
String url = ds.getUrl();
if (url != null)
writer.print(ds.getUrl());
writer.print("\" ");
代码示例来源:origin: codehaus-cargo/cargo
@Override
protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
{
Map<String, String> datasourceProperties = new HashMap<String, String>();
datasourceProperties.put("name", ds.getId());
datasourceProperties.put("jndi-name", getDataSourceJndi(ds));
datasourceProperties.put("driver-name", ds.getDriverClass());
datasourceProperties.put("connection-url", ds.getUrl());
datasourceProperties.put("user-name", ds.getUsername());
datasourceProperties.put("password", ds.getPassword());
if (TransactionSupport.NO_TRANSACTION.equals(ds.getTransactionSupport()))
{
datasourceProperties.put("jta", "false");
}
else
{
datasourceProperties.put("jta", "true");
}
String dsProps = mapResourceProperties(datasourceProperties);
propertiesMap.put("cargo.datasource.properties", dsProps);
}
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-wildfly
@Override
protected void addConfigurationScriptProperties(Map<String, String> propertiesMap)
{
Map<String, String> datasourceProperties = new HashMap<String, String>();
datasourceProperties.put("name", ds.getId());
datasourceProperties.put("jndi-name", getDataSourceJndi(ds));
datasourceProperties.put("driver-name", ds.getDriverClass());
datasourceProperties.put("connection-url", ds.getUrl());
datasourceProperties.put("user-name", ds.getUsername());
datasourceProperties.put("password", ds.getPassword());
if (TransactionSupport.NO_TRANSACTION.equals(ds.getTransactionSupport()))
{
datasourceProperties.put("jta", "false");
}
else
{
datasourceProperties.put("jta", "true");
}
String dsProps = mapResourceProperties(datasourceProperties);
propertiesMap.put("cargo.datasource.properties", dsProps);
}
}
代码示例来源:origin: codehaus-cargo/cargo
sb.append(" <New class=\"com.mchange.v2.c3p0.ComboPooledDataSource\">\n");
sb.append(" <Set name=\"driverClass\">" + ds.getDriverClass() + "</Set>\n");
sb.append(" <Set name=\"jdbcUrl\">" + ds.getUrl() + "</Set>\n");
sb.append(" <Set name=\"user\">" + ds.getUsername() + "</Set>\n");
sb.append(" <Set name=\"password\">" + ds.getPassword() + "</Set>\n");
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-glassfish
DataSource dataSource = new DataSource("jdbc/__default",
firstDS.getConnectionType(), firstDS.getTransactionSupport(),
firstDS.getDriverClass(), firstDS.getUrl(), firstDS.getUsername(),
firstDS.getPassword(), "DummyCargoDefaultDS-" + firstDS.getId(),
new Properties(firstDS.getConnectionProperties()));
代码示例来源:origin: codehaus-cargo/cargo
/**
* This method converts the DataSource to a Resource.
*
* @param ds DataSource to convert to a resource.
* @param resourceType the type of the Resource to convert to. ex.
* <code>javax.sql.DataSource</code>
* @param driverParameter the name of the parameter to store {@link DataSource#getDriverClass()
* driverClass}.
* @return a Resource representing the assignable fields of the DataSource.
*/
public Resource convertToResource(DataSource ds, String resourceType, String driverParameter)
{
Properties parameters = new Properties();
if (ds.getUrl() != null)
{
PropertyUtils.setPropertyIfNotNull(parameters, "url", ds.getUrl());
}
PropertyUtils.setPropertyIfNotNull(parameters, "user", ds.getUsername());
PropertyUtils.setPropertyIfNotNull(parameters, "password", ds.getPassword());
PropertyUtils.setPropertyIfNotNull(parameters, driverParameter, ds.getDriverClass());
parameters.putAll(ds.getConnectionProperties());
Resource resource = new Resource(ds.getJndiLocation(), resourceType);
resource.setParameters(PropertyUtils.toMap(parameters));
return resource;
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-tomcat
/**
* This method converts the DataSource to a Resource used in Tomcat.
*
* @return a Resource that can be used in Tomcat.
* @param ds the DataSource we are configuring.
*/
protected Resource convertToResource(DataSource ds)
{
Properties parameters = new Properties();
PropertyUtils.setPropertyIfNotNull(parameters, "url", ds.getUrl());
PropertyUtils.setPropertyIfNotNull(parameters, "username", ds.getUsername());
PropertyUtils.setPropertyIfNotNull(parameters, "password", ds.getPassword());
parameters.putAll(ds.getConnectionProperties());
Resource resource = new Resource(ds.getJndiLocation(), ConfigurationEntryType.DATASOURCE);
PropertyUtils.setPropertyIfNotNull(parameters, "driverClassName", ds.getDriverClass());
resource.setParameters(PropertyUtils.toMap(parameters));
return resource;
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* This method converts the DataSource to a Resource used in Tomcat.
*
* @return a Resource that can be used in Tomcat.
* @param ds the DataSource we are configuring.
*/
protected Resource convertToResource(DataSource ds)
{
Properties parameters = new Properties();
PropertyUtils.setPropertyIfNotNull(parameters, "url", ds.getUrl());
PropertyUtils.setPropertyIfNotNull(parameters, "username", ds.getUsername());
PropertyUtils.setPropertyIfNotNull(parameters, "password", ds.getPassword());
parameters.putAll(ds.getConnectionProperties());
Resource resource = new Resource(ds.getJndiLocation(), ConfigurationEntryType.DATASOURCE);
PropertyUtils.setPropertyIfNotNull(parameters, "driverClassName", ds.getDriverClass());
resource.setParameters(PropertyUtils.toMap(parameters));
return resource;
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Get a properties object containing all of the members of this datasource object. Note that
* driver properties will be nested and delimited by a semicolon.
*
* @param data DataSource to serialize into properties.
* @return a properties object corresponding to this datasource
*/
public Properties toProperties(DataSource data)
{
Properties properties = new Properties();
PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.JNDI_LOCATION, data
.getJndiLocation());
PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.CONNECTION_TYPE,
data.getConnectionType());
PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.TRANSACTION_SUPPORT,
data.getTransactionSupport());
PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.DRIVER_CLASS, data
.getDriverClass());
PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.URL, data.getUrl());
PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.USERNAME, data
.getUsername());
PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.PASSWORD, data
.getPassword());
PropertyUtils.setPropertyIfNotNull(properties, DatasourcePropertySet.ID, data.getId());
PropertyUtils.setPropertyIfNotNull(properties,
DatasourcePropertySet.CONNECTION_PROPERTIES,
getConnectionPropertiesAsASemicolonDelimitedString(data));
return properties;
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jrun
createTextContentChild(datasourceElement, "jndi-name", ds.getJndiLocation());
createTextContentChild(datasourceElement, "driver", ds.getDriverClass());
createTextContentChild(datasourceElement, "url", ds.getUrl());
createTextContentChild(datasourceElement, "username", ds.getUsername());
createTextContentChild(datasourceElement, "password", ds.getPassword());
代码示例来源:origin: codehaus-cargo/cargo
createTextContentChild(datasourceElement, "jndi-name", ds.getJndiLocation());
createTextContentChild(datasourceElement, "driver", ds.getDriverClass());
createTextContentChild(datasourceElement, "url", ds.getUrl());
createTextContentChild(datasourceElement, "username", ds.getUsername());
createTextContentChild(datasourceElement, "password", ds.getPassword());
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jboss
getAntUtils().addTokenToFilterChain(filterChain, "url", ds.getUrl());
getAntUtils().addTokenToFilterChain(filterChain, "driverClass", ds.getDriverClass());
getAntUtils().addTokenToFilterChain(filterChain, "username", ds.getUsername());
代码示例来源:origin: codehaus-cargo/cargo
getAntUtils().addTokenToFilterChain(filterChain, "url", ds.getUrl());
getAntUtils().addTokenToFilterChain(filterChain, "driverClass", ds.getDriverClass());
getAntUtils().addTokenToFilterChain(filterChain, "username", ds.getUsername());
内容来源于网络,如有侵权,请联系作者删除!