createDBConnection command

Creates a database connection.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-createDBconnection------------------------------------------->

>--+- -dbConfigFile--database-connection-config-file--+---------------------------+-- -password--password-+-><
   |                                                  '- -connectionName--conName-'                       |   
   '- -help-----------------------------------------------------------------------------------------------'   

Parameters

-dbConfigFile database-connection-config-file
Specifies the database connection configuration file that includes the information that is needed to create a new database connection.
-connectionName conName
Specifies the server connection to issue the command to.
-password password
Specifies the password for the user name that is set by the -user argument in the connect command. This parameter is needed only for non-interactive mode if you do not specify -storePassword YES when you issue the connect command.
Important: Only the connect and saveConfig commands will prompt you for a password if you do not specify one. No other commands will prompt you for a password, so you need to specify the password in the command explicitly.
-help
Displays help for this command.

Description

The createDBconnection command uses the database connection configuration file, which contains the information for one single database, to create one new database connection with a unique database connection name, database type, database name for this data source, host machine, port number, and database user name and password.

The length of the name for the database connection can be 2 to 30 characters long. You can use letters (A-Z, a-z), numbers (0-9), hyphens ("-"), and underscores ("_").

Example

Example 1: Create a database connection by specifying a configuration file that contains information that is needed to create a database connection named dstest.
createDBconnection -dbConfigFile dbconfig.txt

Here is an example of a database connection configuration file:

# unique database connection name
# required
name=dstest

# database type
# valid values: DB2LUW
# required 
dataServerType=DB2LUW

# database name for this data source
# required
databaseName=AROMA

# host machine for the database
# required
serverName=localhost

# port number of the database service
# required
portNumber=50000

# database user name
# required
user=db2admin

# password for the database user
# param name can be password, password.decrypted
# If you use a password, the value will be the encrypted password.
# optional The default value will be "".
password = si7lie90jej8wk3k
password.decrypted=wh08busy


Feedback | Information roadmap