Skip to main content
Skip table of contents

Connecting to Fountain via SQL

You can use SQL to connect to Fountain in the Data Virtuality Studio or the Code Editor in the Web UI.

Pre-requisites

  • You need the token.

How to Connect

Before you start retrieving data, you need to run the connector script for Fountain in the Data Virtuality Studio or the Web UI and input your credentials in the following line: 

SQL
CALL SYSADMIN.createConnection (
    name => 'fountain_src'
    ,jbossCLITemplateName => 'ws'
    ,connectionOrResourceAdapterProperties => 'EndPoint=https://api.fountain.com/v2'
);;
 
CALL SYSADMIN.createDataSource (
    name => 'fountain_src'
    ,translator => 'fountain'
    ,modelProperties => 'token=<API Security Token>,cleanupMethod=DELETE,multitenancy_tablename=<multitenancy_tablename>'
    ,translatorProperties => ''
);;
 
CALL SYSADMIN.createVirtualSchema (name => 'fountain');;
 
CREATE VIEW fountain.Credentials
AS
    SELECT
        '<label_1>' AS label,
        '<token_1' AS token
    UNION ALL
    SELECT
        '<label_2>' AS label,
        '<token_2' AS token
    ;;

You may add additional sets using UNION ALL - just make sure the labels are unique.

You may optionally add a multi-tenancy table if you wish to access data from multiple accounts in the API. keep in mind, that you have to manually pass a label parameter to the procedures of the API, which will identify, which credentials should be used in the request. If you are not using multi-tenancy, remove the multitenancy_tablename parameter from the model properties, as the default value is not intended to be present in production environments.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.