Package org.h2.tools
Class Upgrade
- java.lang.Object
-
- org.h2.tools.Upgrade
-
public final class Upgrade extends java.lang.Object
Upgrade utility.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.sql.Driver
loadH2(int version)
Loads the specified version of H2 in a separate class loader.static void
unloadH2(java.sql.Driver driver)
Unloads the specified driver of H2.static boolean
upgrade(java.lang.String url, java.util.Properties info, int version)
Performs database upgrade from an older version of H2.
-
-
-
Method Detail
-
upgrade
public static boolean upgrade(java.lang.String url, java.util.Properties info, int version) throws java.lang.Exception
Performs database upgrade from an older version of H2.- Parameters:
url
- the JDBC connection URLinfo
- 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:
java.lang.Exception
- on failure
-
loadH2
public static java.sql.Driver loadH2(int version) throws java.io.IOException, java.lang.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:
java.io.IOException
- on I/O exceptionjava.lang.ReflectiveOperationException
- on exception during initialization of the driver
-
unloadH2
public static void unloadH2(java.sql.Driver driver) throws java.lang.ReflectiveOperationException
Unloads the specified driver of H2.- Parameters:
driver
- the driver to unload- Throws:
java.lang.ReflectiveOperationException
- on exception
-
-