Declaring Data Sources
If your mashup script invokes SQL queries or statements directly, you typically refer to named datasources that have already been configured in the Presto Server called implicit datasources. If needed, you can explicitly declare a <datasource> with connection information for a database directly in the mashup script. You can use several named datasources in a mashup script as well as a single, explicitly declared, default datasource.
The advantages, disadvantages and configuration requirements for implicit and explicit datasources include:
Datasource | Advantages | Disadvantages | Configuration |
Implicit Configured in the Presto Server by Presto administrators. Tip: | It is a best practice to use implicit datasources. |
| ![*](bullet.gif) Single, consistent configuration. ![*](bullet.gif) Easily managed in clustered environments. ![*](bullet.gif) Credentials for database access are secure (encrypted in the Presto Repository). ![*](bullet.gif) Supports 'hot' updates to drivers without restarting the Presto Server. | ![*](bullet.gif) Does not support dynamic connection information. Connection and credential information is static in the Presto Repository. | |
Explicit Declared in the mashup script using the <datasource> element. | ![*](bullet.gif) Can support dynamic connection information or credentials using Presto attributes or input parameters to the mashup script. | ![*](bullet.gif) Credentials and connection information is less secure, as clear text within the mashup script or defined as input parameters or Presto attributes. ![*](bullet.gif) Configuration is in individual mashup scripts, and thus harder to manage and maintain consistency. ![*](bullet.gif) If datasources are named, connection information must be consistent across all mashup scripts in the Presto Repository. | |
Using implicit named datasources in
EMML is a best practice. See also
Named Datasources versus the Default Datasource for more information.
See
Explicitly Defining the Connection and
Dynamic Connections for instructions on declaring datasources explicitly. See
Working Samples for information on mashup samples for datasources.