By Madhavi Amirneni and Eric Radzinski
Db2 for z/OS Developer Extension is a Microsoft Visual Studio Code (VS Code) extension for working with Db2 for z/OS data and database objects. Originally released in 2020, Db2 Developer Extension was designed with application developers in mind to provide them with a familiar interface for accessing Db2 for z/OS. However, since that initial release, the capabilities offered by Db2 Developer Extension have expanded to address many of the common tasks that a Db2 for z/OS DBA performs on a daily basis as well, including:
- Creating database connections
- Navigating the Db2 catalog
- Creating, editing, and running SQL
- Analyzing and tuning SQL
- And more
If you’re a Db2 for z/OS DBA who isn’t familiar with Db2 Developer Extension, you might appreciate it as a lightweight, easy-to-install, easy-to-use option for keeping your Db2 for z/OS environment running smoothly. And if you’re a database application developer, you’re likely already familiar with VS Code and all that is has to offer, but maybe you haven’t explored Db2 Developer Extension yet.
The purpose of this blog is to introduce new users to VS Code and Db2 Developer Extension and to get them up and running quickly with setting up Db2 Developer Extension on VS Code.
Prerequisites for installing and using Db2 Developer Extension
In addition to a supported version of VS Code, you’ll also need:
- A supported Java SDK or JRE
- An IBM Data Server Driver and a license for connecting to Db2 for z/OS
Optional capabilities, such as SQL analysis and tuning, require additional software.
Getting started with Visual Studio Code
VS Code is one of the industry's leading and most widely used integrated development environments (IDE). You can download it free of charge from
See the VS Code documentation for information about installing VS Code, a list of useful features, tutorials, and more.
The first time that you open VS Code, you’re presented with the Welcome page:
After you’ve installed VS Code, you’re ready to install Db2 Developer Extension:
- Click the Extensions icon in the Activity bar in the far-left column of the VS Code interface:
Then type “ibm z” in the search field at the top of the EXTENSIONS:MARKETPLACE panel.
- Locate IBM Db2 for z/OS Developer Extension in the list that’s displayed and click it to display its home page.
- From here, simply click Install to add Db2 Developer Extension to your VS Code environment.
The Db2 Developer Extension interface
After you install Db2 Developer Extension, click its icon in the Activity bar to open it:
You’ll be presented with an empty framework that looks like this:
The primary side bar contains four views that will be populated as you work with Db2 Developer Extension:
- Before you can run a SQL query in Db2 for z/OS, you must first create a connection to the Db2 subsystem that you want to work with. When you create a connection, it will be added to the DB2 FOR Z/OS CONNECTIONS view.
- As you run SQL queries, the QUERY HISTORY view will be populated with your statement so that you can easily modify and rerun them as needed.
- If you add SQL tuning capabilities to your Db2 Developer Extension environment, you’ll need to specify one or more SQL Tuning Services servers. After you add a tuning server, it will be displayed in the SQL TUNING SERVICES SERVERS view.
- And as you tune SQL statements, the results of the tuning actions that you run are displayed in the TUNING HISTORY view.
A version indicator is also displayed on the extension’s home page (2.1.7 in our example). To automatically check for and install updates to Db2 Developer Extension, leave the Auto update checkbox selected.
When you open the Db2 Developer Extension user interface for the first time, the largest chunk of real estate is occupied by the Db2 Developer Extension Readme. However, this area is where you will configure your environment, create and edit SQL files, tune SQL statements, and so on. For example:
- Create a VS Code workspace to store your working SQL files by clicking File > Open Folder and specifying a folder. When you open a folder in VS Code, it automatically becomes a workspace.
- Click File > New File and type any file name that has an extension of .sql. For example, test.sql.
- When the Save As dialog opens, make sure that the folder that you specified in step 1 is specified. When you click Create File, the Readme is replaced by an empty SQL editor.
- Start to type “CREATE” in the empty file and notice that you’re presented with a dynamic list of SQL statement types, each of which displays a template for building out your statement. Click one to populate your empty file with that template:
After you’ve been working with Db2 Developer Extension for a while and using all of its features, your primary side bar will start to look something like this:
Use the VS Code Explorer to display and work with the files and folders in your project. You can open it by clicking View > Explorer or by clicking the Explorer icon in the Activity bar:
What's next?
This blog provides just a very basic introduction to Db2 Developer Extension. You can learn about its many other capabilities by exploring our documentation repository, which covers the following topics and more:
Connecting to Db2
Navigating the Db2 catalog
Running an SQL statement
Working with stored procedures
Analyzing and tuning SQL (requires IBM SQL Tuning Services)
We hope that this quick introduction helps to make your first experience with Db2 Developer Extension a positive one.