18.5 Create Connections

Connections capture information on the systems where data is stored. The connections could be databases, cloud storage, applications, or services from where data is extracted or loaded.

This example illustrates a script that creates two Oracle connections in Data Transforms:

from datatransforms.workbench import DataTransformsWorkbench,WorkbenchConfig
from datatransforms.connection import Connection
from datatransforms.connection_types import  ConnectionTypes, ConnectionTypeDrivers

pswd="<your deployment pswd from secret store>"
connect_params = WorkbenchConfig.get_workbench_config(pswd)
workbench = DataTransformsWorkbench()
workbench.connect_workbench(connect_params)

src_connection = Connection()\
    .connection_name("Demo Source Data")\
    .with_credentials("admin",Connection.encode_pwd("password goes here"))\
    .using_driver(ConnectionTypeDrivers.ORACLE)\
    .usingWallet("/path/of/the/source_dbwallet_file.zip")\
    .property("serviceName","your_adw_service")
src_connection.technology=ConnectionTypes.ORACLE.value

workbench.save_connection(src_connection)


dw_connection = Connection()\
    .connection_name("Demo Target Data")\
    .with_credentials("admin",Connection.encode_pwd("password goes here"))\
    .using_driver(ConnectionTypeDrivers.ORACLE)\
    .usingWallet("/path/of/the/targt_dbwallet_file.zip")\
    .property("serviceName","datatransformsdemos_high")

dw_connection.technology=ConnectionTypes.ORACLE.value

workbench.save_connection(dw_connection)

WARNING:

Never check-in or manage the production code with plain text passwords.