Package org.h2.tools

Class Upgrade

java.lang.Object
org.h2.tools.Upgrade

public final class Upgrade extends Object
Upgrade utility.
  • Method Details

    • upgrade

      public static boolean upgrade(String url, Properties info, int version) throws Exception
      Performs database upgrade from an older version of H2.
      Parameters:
      url - the JDBC connection URL
      info - the connection properties ("user", "password", etc).
      version - the old version of H2
      Returns:
      true on success, false if URL is a remote or in-memory URL
      Throws:
      Exception - on failure
    • loadH2

      public static Driver loadH2(int version) throws IOException, ReflectiveOperationException
      Loads the specified version of H2 in a separate class loader.
      Parameters:
      version - the version to load
      Returns:
      the driver of the specified version
      Throws:
      IOException - on I/O exception
      ReflectiveOperationException - on exception during initialization of the driver
    • unloadH2

      public static void unloadH2(Driver driver) throws ReflectiveOperationException
      Unloads the specified driver of H2.
      Parameters:
      driver - the driver to unload
      Throws:
      ReflectiveOperationException - on exception