/** * Construct a DataSource from a list of properties. * * @param properties A list of properties representing this datasource * @return DataSource representing the properties * @see PropertyUtils#splitPropertiesOnPipe(String) */ public DataSource fromProperties(Properties properties) { String jndiLocation = properties.getProperty(DatasourcePropertySet.JNDI_LOCATION); String connectionType = properties.getProperty(DatasourcePropertySet.CONNECTION_TYPE); TransactionSupport transactionSupport = TransactionSupport.valueOf( properties.getProperty(DatasourcePropertySet.TRANSACTION_SUPPORT)); String driverClass = properties.getProperty(DatasourcePropertySet.DRIVER_CLASS); String url = properties.getProperty(DatasourcePropertySet.URL); String username = properties.getProperty(DatasourcePropertySet.USERNAME); String password = properties.getProperty(DatasourcePropertySet.PASSWORD); String id = properties.getProperty(DatasourcePropertySet.ID); String driverPropertiesAsASemicolonDelimitedString = properties.getProperty(DatasourcePropertySet.CONNECTION_PROPERTIES); Properties connectionProperties = getDriverPropertiesFromString( driverPropertiesAsASemicolonDelimitedString); DataSource data = new DataSource(jndiLocation, connectionType, transactionSupport, driverClass, url, username, password, id, connectionProperties); return data; }