DataSourceHelper { public static void setConfigurationOption(IDataSource dataSource, String name, String value) { String realName = StringUtil.toFirstUpper(name); try { Method m = dataSource.getClass().getMethod(SETTER_PREFIX + realName, String.class); m.invoke(dataSource, value); } catch (SecurityException e) { throw new IllegalArgumentException("Cannot access set" + name + ". Setting configuration option for data source failed!", e); } catch (NoSuchMethodException e) { throw new IllegalArgumentException( "Data Source does not have any configuration option " + name + "!", e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Cannot access set" + name + ". Setting configuration option for data source failed!", e); } catch (InvocationTargetException e) { throw new IllegalArgumentException("Error while setting option " + name + " on data source: " + e.getMessage(), e); } } private  DataSourceHelper(); static List<DataSourceConfigurationOption> getConfigurationOptionsFor(
			Class<? extends IDataSource> dataSource); static List<DataSourceConfigurationOption> getConfigurationOptionsFor(
			IDataSource dataSource); static boolean isValidConfigurationOption(IDataSource dataSource,
			String propertyName); static void setConfigurationOption(IDataSource dataSource,
			String name, String value); static List<String> validateDataSourceAnnotation(
			Class<? extends IDataSource> ds); static List<String> validateMethodAnnotations(
			Class<? extends IDataSource> ds); static String getName(IDataSource ds); static String getShortName(IDataSource ds);  }
@Test public void testSetConfigurationOption() throws Exception { DataSourceHelper.setConfigurationOption(dataSource, "A", "aa"); assertEquals("aa", dataSource.a); DataSourceHelper.setConfigurationOption(dataSource, "B", "bb"); assertEquals("bb", dataSource.b); }