Code example for Properties

Methods: getProperty

0
 
	private DataSource dataSource;
 
	public MysqlConfig(Properties p)
    { 
		String uri = p.getProperty(URI_PROPERTY);
		String useConfigs = p.getProperty(USE_CONFIGS_PROPERTY);
 
		if (uri == null)
		{ 
			throw new ConfigurationException("Please define a MySQL URI for property: " + URI_PROPERTY);
		} 
		 
		MysqlConnectionPoolDataSource ds = new MysqlConnectionPoolDataSource();
		ds.setUrl(uri);
		 
		if (useConfigs != null)
		{ 
			ds.setUseConfigs(useConfigs);
		} 
		ds.setUser("benchmarkdbuser");