Package net.datacrow.core

Examples of net.datacrow.core.Version


            rs.close();
            stmt.close();
           
        } catch (SQLException se) {}
       
        return new Version(major, minor, build, patch);
    }
View Full Code Here


       
        return new Version(major, minor, build, patch);
    }
   
    public boolean isNew() {
      return getVersion(DatabaseManager.getConnection()).equals(new Version(0, 0, 0, 0));
    }
View Full Code Here

    public boolean isNew() {
      return getVersion(DatabaseManager.getConnection()).equals(new Version(0, 0, 0, 0));
    }
   
    private void updateVersion(Connection connection) throws SQLException {
        Version v = DataCrow.getVersion();
        Statement stmt = connection.createStatement();
        stmt.execute("DELETE FROM VERSION");
        stmt.execute("INSERT INTO VERSION(MAJOR, MINOR, BUILD, PATCH) VALUES (" +
                     v.getMajor() + "," + v.getMinor() + "," + v.getBuild() + "," + v.getPatch() + ")");
    }
View Full Code Here

                sb.append(s);
            }

            String s = sb.toString();
            s = s.indexOf("\n") > -1 ? s.substring(0, s.indexOf("\n")) : s;
            version = new Version(s);
           
            bis.close();
            is.close();
        }
       
        if (version == null || version.isUndetermined()) {
            if (!DcSwingUtilities.displayQuestion("msgCouldNotDetermineVersion"))
                return false;
        } else if (version != null && version.isOlder(new Version(3, 4, 13, 0))) {
            if (!DcSwingUtilities.displayQuestion("msgOldVersion3.4.12"))
                return false;
        } else if (version != null && version.isOlder(new Version(3, 8, 16, 0))) {
            if (!DcSwingUtilities.displayQuestion("msgOldVersion3.8.16"))
                return false;
        }
       
        return true;
View Full Code Here

private static Logger logger = Logger.getLogger(DatabaseUpgradeBeforeInitialization.class.getName());
   
    public void start() {
        try {
            boolean upgraded = false;
            Version v = DatabaseManager.getVersion();
            if (v.isOlder(new Version(3, 9, 0, 0))) {
              cleanupReferences();
              DcSettings.set(DcRepository.Settings.stGarbageCollectionIntervalMs, Long.valueOf(0));
              upgraded |= createIndexes();
            }
View Full Code Here

private static Logger logger = Logger.getLogger(DatabaseUpgradeAfterInitialization.class.getName());
   
    public void start() {
        try {
            boolean upgraded = false;
            Version v = DatabaseManager.getVersion();
            LogForm lf = null;
            if (v.isOlder(new Version(3, 9, 2, 0))) {
                lf = new LogForm();
                DcSwingUtilities.displayMessage(
                        "Data Crow will perform a non critical upgrade. This process will take a couple of minutes.");
              upgraded = fillUIPersistFields();
            }

            if (v.isOlder(new Version(3, 9, 6, 0))) {
                lf = new LogForm();
                DcSwingUtilities.displayMessage(
                        "Data Crow will perform a non critical upgrade to clear unwanted characters from languages, countries and other items.");
                upgraded = cleanupNames();
            }
           
            if (v.isOlder(new Version(3, 9, 8, 0))) {
                lf = new LogForm();
                DcSwingUtilities.displayMessage(
                    "- Ghost references will be removed. \n " +
                    "- The names of all persons (actors, authors, etc) will be formatted to read \"Lastname, Firstname\".\n" +
                    "- The sort index for persons will be recalculated.");
                upgraded = cleanupReferences();
                upgraded = reverseNames();
                upgraded = fillUIPersistFieldsPersons();
            }
           
            if (v.isOlder(new Version(3, 9, 9, 0))) {
                lf = new LogForm();
                DcSwingUtilities.displayMessage(
                        "- Names of authors will be corrected. \n" +
                        "- Pictures of previously deleted items will now be removed. This is a non crucial system task which can take a few minutes.");
                upgraded = cleanupPictures();
View Full Code Here

    public static Version getVersion() {
        Connection connection = getAdminConnection();
        if (connection != null)
            return db.getVersion(connection);
        else
            return new Version(0,0,0,0);
    }
View Full Code Here

TOP

Related Classes of net.datacrow.core.Version

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.