code: protected final <T> T createDataSource(Class<T> dataSourceClass) throws SQLException {
  		if (getRealDataSourceClassName() == null) {
  			throw new SQLException("Property realDataSourceClassName is not set");
  		}
  		try {
  			T ds = dataSourceClass.cast(Class.forName(realDataSourceClassName).newInstance());
  			for (Method m : ds.getClass().getMethods()) {
  				String methodName = m.getName();
  				if (methodName.startsWith("set") && m.getParameterTypes().length == 1) {
  					final Object propertyValue;
  					if (methodName.equals("setUser")) {
  						propertyValue = getUser();
  					} else if (methodName.equals("setPassword")) {
  						propertyValue = getPassword();
  					} else if (methodName.equalsIgnoreCase("setUrl")) {
  						propertyValue = getRealUrl();
  					} else if (methodName.equals("setLogWriter")) {
  						propertyValue = getLogWriter();
  					} else if (methodName.equals("setLoginTimeout")) {
  						propertyValue = getLoginTimeout();
  					} else {
  						String propertyName = methodName.substring(3, 4).toLowerCase();
  						if (methodName.length() > 4) {
  							propertyName += methodName.substring(4);
  						}
  						final Class<?> propertyType = m.getParameterTypes()[0];
  						propertyValue = getPropertyAs(propertyName, propertyType);
  					}
  					if (propertyValue != null) {
  						m.invoke(ds, propertyValue);
  					}
  				}
  			}
  			return ds;
  
  		} catch (Exception e) {
  			throw new SQLException(e);
  		}
  	}
docs: Instantiates the DataSource.
  
  @param dataSourceClass Expected DataSource class
  @param <T> DataSource type
  @return Create DataSource
  @throws SQLException