Up and Running(1) : IBM Db2 for z/OS Developer Extension for Visual Studio Code
This is hopefully the first of a number of articles in a series I've entitled "Up and Running" which will describe my early experiences using some new (to me) piece of technology.
The rise in popularity of Visual Studio Code ( https://code.visualstudio.com/ ) has been one of the biggest phenomena in the development community over the last few years. There are many reasons for it including -
- It is cross-platform, supporting Windows, Mac and Linux
- It is open source
- It has a large, and constantly growing, library of extensions available
Up until this point, the tool of choice for developers working with the Db2 family of databases has been IBM Data Studio. This is built on the Eclipse framework ( https://www.eclipse.org ) which became popular for many of the same reasons that VS Code is now becoming popular. The Achilles heel of Eclipse has always been that it is very resource-intensive.
The Eclipse Foundation also has a next-generation IDE - Eclipse Che ( https://www.eclipse.org/che ). The main difference between Eclipse Che and VS Code is that Che is a centrally hosted workspace accessed via a browser whereas VS Code is a local installation on a workstation. As such, Che is ideal for large scale environments where a standard environment is desirable regardless of where the developer signs in. One significant feature of Eclipse Che is that it supports the use of VS Code extensions within its Theia editor component.
Which brings us to the IBM Db2 for z/OS Developer Extension for VS Code. I heard about this early in 2020 and became a "Sponsor User" (IBM terminology for a beta tester) shortly thereafter. The first public release to the VS Code Marketplace was on 28th July 2020 -
https://marketplace.visualstudio.com/items?itemName=IBM.db2forzosdeveloperextension
There have so far (7th January 2021) been 5 public releases and the extension has progressed rapidly. The IBM developers have listened to the Sponsor User feedback and prioritized features accordingly. I'd encourage everyone who is interested in Db2 for z/OS development to install this extension and to provide feedback, bug reports and feedback requests through the extensions GitHub repository issues page -
https://github.com/IBM/db2forzosdeveloperextension-about/issues
If you are keen to see the extension continue to progress, and particularly if there are certain features that you feel strongly that it should support, then consider applying to become a Sponsor User.
Installation and setup of the extension is fairly simple. However, I've put together a few notes here that will hopefully help you.
Obviously the first thing you will need to have is Visual Studio Code. All the different downloads for Windows, Mac and Linux are available from this web page -
https://code.visualstudio.com/Download
Once you have VS Code installed you can find and install the extension by searching the Marketplace for "db2", but ensuring you select the Db2 for z/OS Developer Extension as shown in this screenshot -
There are a couple of other prerequisites that you will need to use the extension. The first of these is a suitable Java Runtime Environment (JRE) or Java Developer Kit (JDK), since the extension uses JDBC to communicate with Db2 for z/OS. The information screen for the extension lists supported JDKs. I installed the latest Long Term Support (LTS) version of Oracle Java (11).
You then need to make the extension aware of where the JDK is installed. Go into the VS Code settings using either File / Preferences / Settings or using Ctrl+, (that's Ctrl key and the comma). Then enter "java" in the search box and under Extensions select IBM Db2 for z/OS Developer Extension. There is an option "Db2forzosdeveloperextension> Java: home". Here you need to specify the JDK's installation directory. On Windows it might be a bit difficult to work out exactly where this is, as there are multiple levels of indirection from standard Java executable back to the installation location. I eventually tracked it down to "C:\Program Files\Java\jdk-11.0.9", so hopefully your location will be something similar.
The other prerequisite is the Db2 Connect license JAR to allow you to establish a JDBC connection to Db2 for z/OS. This file is called db2jcc_license_cisuz.jar. This was never an issue for IBM Data Studio, since the file was shipped as part of the Data Studio build (hint !!!) - and hopefully it will be made available in the extension install as well. Until that happens you need to put a copy of this file on your desktop and then point the extension to it by updating the setting "Db2sqlservice: Dependencies" (under the settings for the extension as for the JDK) with the fully qualified path to the JAR file.
With these two prerequisites sorted you are then ready to start using the extension. Highlights of what is available so far include -
- Syntax highlighting for SQL, stored procedures and UDFs
- A library of code snippets covering many different types of SQL
- Support for the .spsql (stored procedure) and .udfsql (UDF) file extensions as created by Data Studio
- Full support for JDBC connection configuration including JDBC tracing and optional JDBC properties (this last feature allows you to set CurrentSQLID and similar properties)
- Runtime options control, such as whether to stop on first error or continue and the ability to use different statement terminators
- Ability to run a single highlighted SQL statement or all SQL statements from any file even if the file does not have a known file extension - really useful for testing SQL embedded in other language files such as COBOL or Java.
Just before Christmas the Sponsor Users got together with the developers and shared with them our priorities for the next phases of development. I'm looking forward to seeing more great features added in the weeks and months ahead.
In the meantime, please install the extension and give it a try.
Phil
Comments
Post a Comment