This document provides the steps to install the Db2Connect VS Code extension. It also provides the steps to use the extension.
- Install and start Visual Studio Code:
- Download and install Visual Studio Code on your machine.
- Launch Visual Studio Code.
- Install the Db2Connect Extension:
- The Db2Connect extension allows the user to connect to a Db2 Server and perform operations.
- In Visual Studio Code, select ‘Extensions’ from the sidebar.
- Search for ‘Db2Connect’.
- Install the Extension based on your platform.
- Db2: Manage connection profiles
- User can create, edit and delete connection profiles using Manage connection profiles.
- Press Ctrl+Shift+P or F1 to open the Command Palette.
- Type Db2 to display the Db2 commands and then select Db2: Manage Connection Profiles.
- Please choose one of the options.
- User can create a connection profile by entering the following details
- Profile Name: Enter the profile name.
- Database: Enter the database name.
- Hostname: The Db2 server that user want to use.
- Port: Enter the Port number.
- Userid: Enter the name of a user with access to a Db2 server.
- Password: Enter the password for the specified user.
- User can test the profile by clicking on the Test Connection button
- Click on “Save and Close” and Profile will be saved.
- User can Edit Connection profile by selecting a profile that user want to edit:
- Database: Enter the database name.
- Hostname: The Db2 server that user want to use
- Port: Enter the Port number
- Userid: Enter the name of a user with access to a Db2 server
- User can change the password by checking on the checkbox.
- Click on “Update and Close” and profile will be saved.
- User can delete connection profile by selecting a profile that user want to delete
Click on “Delete” and profile will be deleted.
- Db2: Connect
- Select View > Command Palette > Db2: Connect
- Choose one of these options.
- If the user selects the first option, an input box where a user can enter the connection string will be prompted.
- If the user selects the second option, a Connection Parameters window will be shown.
Enter details such as Database, Hostname, port, user id, password and click on “Connect” for making a connection.
- If the user chooses the third option, a list of profiles is displayed.
- User can choose any profile and make a connection.
- Db2: Execute Query
- Select View > Command Palette > Db2: Execute Query
- when the user selects Db2: Execute Query user will be prompted to enter the query.
- Enter the Query and press ‘Enter’ to confirm it.
- The result will we displayed in a grid view.
- Db2: Execute Non-Query
- Select View > Command Palette > Db2: Execute Query
- when the user selects Db2: Execute Non-Query user will be prompted to enter the sql.
- Enter the sql and press ‘Enter’ to confirm it.
- Db2: View Command History
- Select View > Command Palette > Db2: View Command History
- when the user selects Db2: View Command History untitled file will be opened where a list of user executed commands are displayed with time.
- User has to copy the sql and paste in the input box of Execute Query or Execute Non-Query
- While closing the untiled file click on don’t save.
- Db2: Rebuild Native Modules
- Select View > Command Palette > Db2: Rebuild Native Modules
- This option is used when a new version of an electron is introduced into the vs code Editor. One can use this command to install the latest ibmdb driver which is compatible with the latest electron version.
- Db2: Disconnect
-
Select View > Command Palette > Db2: Disconnect
-
Disconnects the current opened connection.
- Db2: Report an Issue
- Select View > Command Palette > Db2: Report an Issue
- This option opens the GitHub repository in the browser where the user can raise any issues related to this extension.