private static boolean isSetupMode() {
        if (Boolean.parseBoolean(JiveGlobals.getXMLProperty("setup"))) {
            return false;
        }
        // Check if the DB configuration is done
        if (DbConnectionManager.getConnectionProvider() == null) {
            // DB setup is still not completed so setup is needed
            return true;
        }
        Connection con = null;
        PreparedStatement pstmt = null;
        try {
            con = DbConnectionManager.getConnection();
            // Properties can now be loaded from DB so consider setup done
        }
        catch (SQLException e) {
            // Properties cannot be loaded from DB so do not consider setup done
            return true;
        }
        finally {
            DbConnectionManager.closeConnection(pstmt, con);
        }
        return false;
    }
Returns true if in setup mode. A false value means that setup has been completed
or that a connection to the database was possible to properties stored in the
database can be retrieved now. The latter means that once the database settings
during the setup was done a connection to the database should be available thus
properties stored from a previous setup will be available.

@return true if in setup mode.
xmppserver/src/main/java/org/jivesoftware/util/JiveGlobals.java