Class Upgrade
java.lang.Object
org.h2.tools.Upgrade
Upgrade utility.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]private static StringcopyProperty(ConnectionInfo ci, StringBuilder oldUrl, String name) private static byte[]private static byte[]downloadUsingMaven(String group, String artifact, String version, String sha256Checksum) private static intprivate static StringgetSHA256(byte[] data) static DriverloadH2(int version) Loads the specified version of H2 in a separate class loader.private static voidprivate static voidstatic voidUnloads the specified driver of H2.static booleanupgrade(String url, Properties info, int version) Performs database upgrade from an older version of H2.
-
Field Details
-
CHECKSUMS
-
REPOSITORY
- See Also:
-
-
Constructor Details
-
Upgrade
private Upgrade()
-
-
Method Details
-
upgrade
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:
trueon success,falseif URL is a remote or in-memory URL- Throws:
Exception- on failure
-
rename
- Throws:
IOException
-
rename
- Throws:
IOException
-
copyProperty
-
loadH2
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 exceptionReflectiveOperationException- on exception during initialization of the driver
-
unloadH2
Unloads the specified driver of H2.- Parameters:
driver- the driver to unload- Throws:
ReflectiveOperationException- on exception
-
downloadUsingMaven
private static byte[] downloadUsingMaven(String group, String artifact, String version, String sha256Checksum) throws IOException - Throws:
IOException
-
exec
-
download
-
check
-
getSHA256
-