5.32.5 CONNECT

The CONNECT command connects to a remote database. By default, a connection object is in auto-commit mode, which means that it automatically commits changes after executing each statement.

Syntax:

Command

Keyword

Value

Developer notes

CONNECT

DRIVER

value

Required. Database driver name.

DATABASE

value

Required. Database name.

USER

value

Required. Database server user login.

PASSWORD

value

Required. Database server user password.

 

Example

CONNECT DRIVER(DB2) DATABASE(SALES) USER(user) PASSWORD(password)

 

The driver keyword value is a symbolic name used to locate the service's property entry:

 

driver.db2=com.ibm.as400.access.AS400JDBCDriver

 

The database keyword value is a symbolic name used to locate the service's property entry:

 

database.sales=jdbc:as400://DBHOST/LIBRARY;naming=sql;errors=full;date format=iso;translate binary=true