/// <summary> Get the migration level information for the given system name
        /// 
        /// </summary>
        /// <param name="systemName">the name of the system
        /// </param>
        /// <throws>  Exception if anything goes wrong </throws>
        public virtual int getMigrationInformation(System.String systemName)
        {
            // The MigrationLauncher is responsible for handling the interaction
            // between the PatchTable and the underlying MigrationTasks; as each
            // task is executed, the patch level is incremented, etc.
            try
            {
                DistributedAdoMigrationLauncherFactory launcherFactory = new DistributedAdoMigrationLauncherFactory();
                DistributedAdoMigrationLauncher launcher = (DistributedAdoMigrationLauncher) launcherFactory.createMigrationLauncher(systemName);

                foreach (IAdoMigrationContext context in launcher.Contexts.Keys)
                {
                    int currentLevel = launcher.GetDatabasePatchLevel(context);
                    int nextPatchLevel = launcher.NextPatchLevel;

                    log.Info("Current Database patch level is        : " + currentLevel);

                    int unappliedPatches = nextPatchLevel - launcher.GetDatabasePatchLevel(context) - 1;

                    log.Info("Current number of unapplied patches is : " + unappliedPatches);
                    log.Info("The next patch to author should be     : " + nextPatchLevel);

                    // We are only interested in info about the first one
                    return (nextPatchLevel - 1);
                }

                return 0;
            }
            catch (System.Exception e)
            {
                log.Error(e);
                throw e;
            }
        }
        public static void Main(System.String[] arguments)
        {
            //UPGRADE_TODO: Method 'java.lang.System.getProperties' was converted to 'SupportClass.GetProperties' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangSystemgetProperties'"
            System.String systemName = null;//getRequiredParam("migration.systemname", SupportClass.GetProperties(), arguments);

            // The MigrationLauncher is responsible for handling the interaction
            // between the PatchTable and the underlying MigrationTasks; as each
            // task is executed, the patch level is incremented, etc.
            try
            {
                DistributedAdoMigrationLauncherFactory factory = new DistributedAdoMigrationLauncherFactory();
                AdoMigrationLauncher launcher = factory.createMigrationLauncher(systemName);
                launcher.DoMigrations();
            }
            catch (System.Exception e)
            {
                log.Error(e);
                throw e;
            }
        }