public DbConfig(String dbName) throws IOException {
        dbProperties = new Properties();
        String userHomeProperties = System.getProperty("user.home")+"/."+DB_PROPERTIES;
        try {
            if (new File(userHomeProperties).exists()) {
                dbProperties.load(new FileInputStream(userHomeProperties));
            } else {
                dbProperties.load(getClass().getClassLoader().getResourceAsStream(DB_PROPERTIES));
            }
        } catch (Exception e) {
            throw new RuntimeException("Reading property file '" + userHomeProperties +
            "' or property file '" + DB_PROPERTIES + "' not found in the classpath!");
        }

        dbPrefix = isEmpty(dbName) ? "" : dbName + ".";
        if (isEmpty(getProperty(DB_DRIVER))) {
            throw new RuntimeException("JDBC Driver property '" + dbPrefix + DB_DRIVER + "' not found");
        }
        if (isEmpty(getProperty(DB_URL))) {
            throw new RuntimeException("DB URL property '" + dbPrefix + DB_URL + "' not found!");
        }
        if (isEmpty(getProperty(DB_USER))) {
            dbProperties.put(dbPrefix + DB_USER, CommandReader.readPassword("username: "));
        }
        if (isEmpty(getProperty(DB_PASS))) {
            dbProperties.put(dbPrefix + DB_PASS, CommandReader.readPassword("password: "));
        }
        if (isEmpty(getProperty(DB_AUTO_COMMIT))) {
            dbProperties.put(dbPrefix + DB_AUTO_COMMIT, "true");
        }
        if (isEmpty(getProperty(DB_READ_ONLY))) {
            dbProperties.put(dbPrefix + DB_READ_ONLY, "false");
        }
    }