Package org.h2.tools
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 String
copyProperty
(ConnectionInfo ci, StringBuilder oldUrl, String name) private static byte[]
private static byte[]
downloadUsingMaven
(String group, String artifact, String version, String sha256Checksum) private static int
private static String
getSHA256
(byte[] data) static Driver
loadH2
(int version) Loads the specified version of H2 in a separate class loader.private static void
private static void
static void
Unloads the specified driver of H2.static boolean
upgrade
(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:
true
on success,false
if 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
-