Define a datasource
The datasource contains the details necessary to connect to the SQL database, such as the type of the database, the address and port, and the credentials which should be used to authenticate. New datasources can be defined by the API:
Method: POST Path: /context-sql-sync/datasource Authorization header: Bearer [access_token] Body { "name": "localdb", "jdbcUrl": "jdbc:postgresql://localhost:5432/tm_context_sql_sync", "dbType": "POSTGRES", "username": "postgres", "password": "postgres" }
Parameter | Description |
---|---|
name | An arbitrary string. |
jdbcUrl | A JDBC url, specifying the connection to the database. E.g.: jdbc:mysql://192.0.2.1:3306/database jdbc:postgresql://localhost:5432/database jdbc:sqlserver://localhost:1433;databaseName=database jdbc:redshift://localhost:5439/database |
dbType | Specifies the type of the database. The supported values are: MYSQL POSTGRES MSSQL REDSHIFT Contact your TrendMiner CSM in case of different databases to see how we could help out. |
username/password | The credentials used to access the database; can be omitted if the database does not require authentication. |
The result will contain the id of the newly created datasource. This id will be used later when executing a historical sync or when defining sync jobs.
Define Datasource to connect to SQL Server using windows integrated security
To connect to database using integrated security, the connection details should be as follows:
{ "name": "connection_with_int_security", "jdbcUrl": "jdbc:sqlserver://server_name:port;database=db_name;integratedSecurity=true;authenticationScheme=NTLM;domain=domain_name", "dbType": "MSSQL", "username": "user-name-without-domain-prefix", "password": "password" }