Data Source commands

List Data Sources

Use the list-connections command to view the available connections. Connections are created by placing database connection details in a local file that ends with .dodeca.properties. For example, if your development Dodeca repository is in a MySQL database, you can create a local file named dev.dodeca.properties. The contents of the list-connections command would then list this as an available connection:

dshell/:>list-connections
dev.dodeca.properties

The contents of the file should can include the following values:

dodeca.datasource.url = jdbc:mysql://localhost/dodeca?noDatetimeStringSync=true&useSSL=false
dodeca.datasource.username = root
dodeca.datasource.password = password

The dodeca.datasource.url value should be a valid JDBC database URL for your database environment. You may omit the password from connection file for security purposes, in which case you will be prompted in the shell for the password to the database for the specified user.

Connect to Data Source

Use the connect commmand to connect to a data source using the specified connection file. You may omit the .dodeca.properties suffix.

Encrypt Password in Data Source Connection File

You may want to encrypt the value of dodeca.datasource.password in your connection file. You can use the encrypt command for this. Encrypt takes a single parameter and will output an encrypted version of the password. For example:

dshell/:>encrypt mypassword

You will receive output similar to the following:

ENC(CjzrGUAl14fEcR9Y2zo06lvlTg8fjkTd)

This entire line of text represents the value to place in your connection file. For instance:

dodeca.datasource.url = jdbc:mysql://localhost/dodeca?noDatetimeStringSync=true&useSSL=false
dodeca.datasource.username = root
dodeca.datasource.password = ENC(CjzrGUAl14fEcR9Y2zo06lvlTg8fjkTd)

You may now connect to the data source and Dodeca Shell will use the decrypted password to connect to the Dodeca repository.