Using Liquibase with DB2 on z/OS
Step 1: Download and Extract Liquibase
- Download Liquibase. Visit the download page to get the latest binary.
- After downloading the
*.tar.gz, extract the contents into a folder.
Note: You may want to add this folder to your system PATH environment so that you can execute Liquibase from any directory.
For this tutorial, we will refer to that directory as
LB_HOME, and when executing the Liquibase shell script will use
LB_HOME\liquibase.bat as the example command.
Step 2: Install Java
- Java is a required dependency. Install Java if it is not already installed.
- Validate that you have a working Java version. On the command line, execute:
Ensure that it runs successfully and displays your installed Java version.
Step 3: Download the DB2JCC Driver and License File
The license JAR file is required when connecting to a mainframe DB2 database, which is not a free JAR file. You must purchase the DB2 Connect product. The license file is contained within the activation package for it. For more information regarding the license file, see Location of the db2jcc_license_cisuz.jar file.
Liquibase comes with a pre-installed driver for DB2 in the
liquibase/lib directory. For more information, see Adding and Updating Liquibase Drivers.
Step 4: Set Up the Properties File
While it is possible to pass all required parameters, such as the JDBC driver and database URL on the command line, it is much easier to configure a Liquibase properties file.
Pro Tip: Create multiple Liquibase properties files for your DEV, QA, and PROD environments. You can pass the specific properties file as a Liquibase command line argument.
- Create a new directory for your first Liquibase project, and change into that directory. For this example, we named the directory
- Create a text file named
liquibase.propertiesand add the following content:
Note: Be sure to replace the
<values> with the actual values for your system.
Ensure that you can execute Liquibase. At the command prompt, run one of the following commands, depending on your platform:
You should now see some help output, and you are ready to begin using Liquibase.