public boolean checkOpenfireSchema(Connection con) {
        // Change 'wildfire' to 'openfire' in ofVersion table (update to new name)
        updateToOpenfire(con);
        try {
            return checkSchema(con, "openfire", DATABASE_VERSION,
                    new ResourceLoader() {
                        @Override
                        public InputStream loadResource(String resourceName) {
                            File file = new File(JiveGlobals.getHomePath() + File.separator +
                                    "resources" + File.separator + "database", resourceName);
                            try {
                                return new FileInputStream(file);
                            }
                            catch (FileNotFoundException e) {
                                return null;
                            }
                        }
                    }, true); // Recursion shouldn't be needed, as the Openfire devs are in control of both the installation and upgrade scripts. Then again, it doesn't hurt to check (OF-2940).
        }
        catch (Exception e) {
            Log.error(LocaleUtils.getLocalizedString("upgrade.database.failure"), e);
            System.out.println(LocaleUtils.getLocalizedString("upgrade.database.failure"));
        }
        return false;
    }
Checks the Openfire database schema to ensure that it's installed and up to date.
If the schema isn't present or up to date, an automatic update will be attempted.

@param con a connection to the database.
@return true if database schema checked out fine, or was automatically installed
     or updated successfully.
xmppserver/src/main/java/org/jivesoftware/database/SchemaManager.java