This page is for data modellers who want to connect to an external database, either to load data or to export processed data back to it.
Overview
A datasource is a modelling object whose properties provide the information needed to connect to an external database. You must have one datasource for each type of database to which you need to connect. In an analysis model, you can add:
- a Database Collector to load data from a database.
- a Database Exporter to update the database with processed data from the model.
The datasources you create appear in the Basic Settings → Datasource list in collector and exporter properties.
Each datasource must have at least one datasource instance. You can add several instances if you want to configure different settings. For example you may want to connect to the same database using a different username and password for different scheduled tasks.
In the properties for collectors and exporters, you can optionally specify the datasource instance using the Advanced → Datasource Instance Expression.
The datasource properties are affected by:
- the Privilege Allow anonymous updates on datasources. Only a user with this privilege can change the Allow Anonymous Export tick box.
- the System Configuration option Allow anonymous export by default. When selected, this system option sets Allow Anonymous Export to be ticked by default on new datasources.
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
Datasource Properties
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
When an exporter uses this datasource to connect to a database, by default PhixFlow will use the PhixFlow username and password.
Use this option when the PhixFlow username and password should not or cannot be used, for example in a scheduled task plan. The target database must permit anonymous updates.
tickedYou must have the Allow anonymous updates on datasources privilege to change this option.
Note |
---|
The target database must already have the same username and password with the required permissions. Contact the database administrator to do this. |
Exception: The datasource will be deleted when its parent application is deleted by the import. This prevents orphaned datasources persisting in PhixFlow.
Select the driver class for the type of database to which the datasource connects.
Tip |
---|
The drop-down list may contain driver classes that are deprecated and do not have the necessary database drivers; see Driver Classes. |
Datasource Instances
This section has a toolbar with standard buttons.
The grid contains a list of datasource instances that belong to this datasource. DoubleaddaddDatasource Instance PropertiesFor a datasource instance, you must:
- Enter a Name.
- Enter the URL for the database.
- Specify the Anonymous username and Password.
- Tick the Enabled check box when it is ready to use.
Other settings are optional.
Basic Settings
Name
Enter the name for this instance. In the properties for collectors and exporters, you can specify this instance by using its name in the Datasource Instance Expression.
Enter the URL for the target database.
Example URLs
- Oracle
jdbc:oracle:thin:@hostname:1521:phixflow
- Oracle for versions above 12c, with PDB containers
jdbc:oracle:thin:@hostname:1521/phixflow
- SQL Server
jdbc:sqlserver://
hostname\myservice
;databaseName=phixflow
- MySQL
jdbc:mysql://
hostname
/phixflow
- Big Query
jdbc:bigquery://@hostname:@port;ProjectId=@Project;
Enter a username.
Advanced
Check Query
Use this field when connections to the target database might go stale. This can happen if the target database disconnects long-running connections.
Enter a database query that will return a row from the database.
PhixFlow runs the query against the database just before each use of a pooled connection. If the query does not return a row, the connection is discarded and a new connection is created. To avoid any performance impact, the query should execute quickly.
See the Query String section of the Database Collector page for information about writing SQL queries in PhixFlow.
Use this field when connections to the target database has additional requirements not covered by the datasource and datasource instance properties.
Enter a value to use an external datasource connection profile that PhixFlow will use to connect to the target database.