CONNECT

The CONNECT command is used to connect to the remote database. You must do this before you can perform any activity on the database.

 

 CONNECT --------- DRIVER ----------- value ----------------------->

 

               >-- DATABASE --------- value ----------------------->

 

               >-- USER ------------- value ----------------------->

 

               >-- PASSWORD --------- value -----------------------|

 

Keywords

DRIVER

This keyword is used to specify the name of the JDBC driver you intend to use to access the remote database.

The value specified here must correspond to a key entry in the SQLService properties file. This reference will provide the details of the full name and path of the JDBC driver.

This keyword is mandatory

DATABASE

This keyword is used to specify the database that you wish to connect to with the JDBC driver.

The value specified here must correspond to a key entry in the SQLService properties file. This reference will provide the details of the full name and path of the database.

This keyword is mandatory.

USER

This keyword is used to hold the User ID that you intend to use to connect to the database.

The keyword is mandatory.

PASSWORD

This keyword is used to hold the password for the User ID that you intend to use to connect to the database.

The keyword is mandatory.

Comments / Warnings

By default the connection is made in auto-connect mode, which means it automatically commits changes after each statement.

Any additional database connection properties will need to be placed into the SQLService properties file.

Examples

RDML

 

* Define the JSM message fields

DEFINE FIELD(#JSMSTS) TYPE(*CHAR) LENGTH(020)

DEFINE FIELD(#JSMMSG) TYPE(*CHAR) LENGTH(256)

DEFINE FIELD(#JSMCMD) TYPE(*CHAR) LENGTH(256)

 

CHANGE FIELD(#JSMCMD) TO('CONNECT DRIVER(DB2) DATABASE(JSMJDBC) USER(SMITH) PASSWORD(PASSWORD)')

USE BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)

 

RDMLX

 

* Define the JSM Command related fields

Define Field(#JSMSTS) Type(*Char) Length(020)

Define Field(#JSMMSG) Type(*Char) Length(256)

Define Field(#JSMCMD) Type(*Char) Length(256)

Define Field(#JSMHND) Type(*Char) Length(4)

 

#JSMCMD := 'Connect Driver(DB2) Database(JSMJDBC) User(SMITH) Password(PASSWORD)'

Use Builtin(JSMX_COMMAND) With_Args(#JSMHND #JSMCMD) To_Get(#JSMSTS #JSMMSG)