How to view the contents of the H2 database
Posted by John Villanueva, Last modified by John Villanueva on 07 September 2020 11:47 PM
If, for whatever reason, you wish to view the contents (tables, records, etc.) of JSCAPE MFT Server's embedded H2 database, you can use H2's own browser-based console, which you can download from here:
Once installed, you should be able to launch the console just like any application (e.g. through Apps in Windows) ...
... or by going to the [h2 installation directory]/bin/ directory and running either the h2.bat batch file (if you're in a Windows-based system) or the h2.sh file (if you're in a *nix based system).
This would, in turn, launch the browser-based console. There's also a command-line based console but we won't be discussing that here. Once you've launched the console, you will then need to enter the JDBC URL into the field provided, as well as the database username and password.
The JDBC URL of the embedded H2 database typically takes on the form:
jdbc:h2://C:\Program Files\JSCAPE MFT Server/data/server
wherein you should replace C:\Program Files\JSCAPE MFT Server/ with the installation directory of your JSCAPE MFT Server installation.
Click Test Connection to test the connection or Connect to connect.
Note: If you're unable to login even if you're sure that the JDBC URL and the login credentials are correct, check the version of the h2 jar file in the H2/bin directory. It could be that the jar file doesn't match the jar file used by your JSCAPE MFT Server instance (in [mft server installdir]/libs/ directory).
You can remedy this by copying the j2 jar file from your [mft server installdir]/lib directory to the h2/bin directory and then editing the batch or sh file accordingly.
Once you've successfully logged into the console, you may then execute SQL scripts against the database.