public static DAOFactory getInstance(String dbName) throws DAOConfigurationException {
        if (dbName == null ) {
            throw new DAOConfigurationException("Database name is null");
        }

        DAOProperties properties = new DAOProperties(dbName);
        String url = properties.getProperty(PROPERTY_URL, true);
        String driverClassName = properties.getProperty(PROPERTY_DRIVER, false);
        String password = properties.getProperty(PROPERTY_PASSWORD, false);
        String username = properties.getProperty(PROPERTY_USERNAME, password != null);
        DAOFactory instance;

        //If driver is specified, then load it to let it register itself with DriverMAnager
        if (driverClassName != null) {
            try {
                Class.forName(driverClassName);
            } catch (ClassNotFoundException e) {
                throw new DAOConfigurationException("Driver class '" + driverClassName + "' is missing in classpath.", e);
            }
            instance = new DriverManagerDAOFactory(url, username, password);
        } else {
            instance = new DriverManagerDAOFactory(url, username, password);
        }
        return instance;

    }