public class DataSourceConverter extends Object
Constructor and Description |
---|
DataSourceConverter() |
Modifier and Type | Method and Description |
---|---|
Resource |
convertToResource(DataSource ds,
String resourceType,
String driverParameter)
This method converts the DataSource to a Resource.
|
protected static String |
createIdFromJndiLocation(String jndiLocation)
Get a string name for the configuration of this datasource.
|
DataSource |
fromProperties(Properties properties)
Construct a DataSource from a list of properties.
|
DataSource |
fromPropertyString(String datasourceInformation)
Construct a DataSource from a single String.
|
String |
getConnectionPropertiesAsASemicolonDelimitedString(DataSource data)
tests to see if the value is null before attempting to join the database properties on a
semicolon.
|
Properties |
toProperties(DataSource data)
Get a properties object containing all of the members of this datasource object.
|
String |
toPropertyString(DataSource data)
Get a string representation of this datasource.
|
public DataSource fromPropertyString(String datasourceInformation)
CreateDatabase=create;DatabaseName=TEST
.datasourceInformation
- A string, really a list of properties, representing a datasourcePropertyUtils.splitPropertiesOnPipe(String)
public DataSource fromProperties(Properties properties)
properties
- A list of properties representing this datasourcePropertyUtils.splitPropertiesOnPipe(String)
protected static String createIdFromJndiLocation(String jndiLocation)
jndiLocation
- used to construct the idpublic String toPropertyString(DataSource data)
data
- DataSource to serialize into a string.PropertyUtils#joinPropertiesOnPipe(java.util.Properties)
public Properties toProperties(DataSource data)
data
- DataSource to serialize into properties.public String getConnectionPropertiesAsASemicolonDelimitedString(DataSource data)
data
- DataSource to parse connection properties from.public Resource convertToResource(DataSource ds, String resourceType, String driverParameter)
ds
- DataSource to convert to a resource.resourceType
- the type of the Resource to convert to. ex.
javax.sql.DataSource
driverParameter
- the name of the parameter to store driverClass
.Copyright © 2004-2013 Codehaus. All Rights Reserved.