ifference between revisions of "EMO:Connecting to a Database Server"
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{#hidens:}} | {{#hidens:}} | ||
− | '''WARNING!''' Connecting to a local or networked database server is complex and can be time-consuming. If no people in your company have previous experience of configuring ''EMarketOffer'' it is strongly recommended that you consult your company's technical support and also the Energy Link helpdesk for advice on the best approach. | + | '''WARNING!''' Connecting to a local or networked database server is complex and can be time-consuming. If no people in your company have previous experience of configuring ''EMarketOffer'' it is strongly recommended that you consult your company's technical support and also the Energy Link [[Help:Contents|helpdesk]] for advice on the best approach. |
---- | ---- | ||
Line 237: | Line 237: | ||
A Configuration contains a collection of queries that may reference more than one online database. Each query can reference a single database using a pre-defined Connection containing the information required to interact with a database server; once defined a Connection can be used repeatedly by the queries in a Configuration. | A Configuration contains a collection of queries that may reference more than one online database. Each query can reference a single database using a pre-defined Connection containing the information required to interact with a database server; once defined a Connection can be used repeatedly by the queries in a Configuration. | ||
− | The main component of a Connection is the Connection String which EMarketOffer uses to locate and connect to online database servers. The string varies in format depending on the target database server type and its specific access security provisions. It may contain: | + | The main component of a Connection is the Connection String which ''EMarketOffer'' uses to locate and connect to online database servers. The string varies in format depending on the target database server type and its specific access security provisions. It may contain: |
*A data provider: this specifies the type of database server to be accessed (e.g. Oracle or MS SQL) and the specific access protocol to be used (e.g. OleDB or ODBC) | *A data provider: this specifies the type of database server to be accessed (e.g. Oracle or MS SQL) and the specific access protocol to be used (e.g. OleDB or ODBC) | ||
*Name of the database to be accessed (if required) | *Name of the database to be accessed (if required) | ||
Line 243: | Line 243: | ||
*A Data Source Name (DSN) file containing the above information | *A Data Source Name (DSN) file containing the above information | ||
− | See the section on ''''' | + | See the section on '''''[[EMO:Securing Database Access|Securing Database Access]]''''' for more information on Connection Strings. |
A separate query is used for each data item to be imported. Each query must be associated with a Connection and contain a standard SQL-compliant query string defining the specific data to be returned. Query strings should: | A separate query is used for each data item to be imported. Each query must be associated with a Connection and contain a standard SQL-compliant query string defining the specific data to be returned. Query strings should: | ||
Line 258: | Line 258: | ||
===Creating a Database Connectivity Configuration=== | ===Creating a Database Connectivity Configuration=== | ||
− | The functions used in Configuration setup are fully described in the [[EMO:Menu Bar|Menu Bar]] segment under the [[EMO:The Main Window|Main Window]] section. | + | The functions used in Configuration setup are fully described in the '''''[[EMO:Menu Bar|Menu Bar]]''''' segment under the '''''[[EMO:The Main Window|Main Window]]''''' section. |
− | [[ | + | [[Main Page|Home]] |
Latest revision as of 14:08, 7 February 2014
WARNING! Connecting to a local or networked database server is complex and can be time-consuming. If no people in your company have previous experience of configuring EMarketOffer it is strongly recommended that you consult your company's technical support and also the Energy Link helpdesk for advice on the best approach.
Terminology
EMarketOffer's data design consists of 'things' included in the model, and their characteristics'. In this manual the 'things' are called Entities and their characteristics are called Traits. Traits may be static or dynamic.
For example the Circuit Entity can have the static Traits of Start Node and End Node, and the dynamic Traits of Powerflow and Loss by Trading Period.
Input Data Types
EMarketOffer can load the folowing types of Input data directly from external databases.
Entity | Type | Trait | Mandatory | Defined by |
---|---|---|---|---|
Node |
|
|
|
|
|
|
|
| |
Unit |
|
|
|
|
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
Circuit |
|
|
|
|
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
Equation |
|
|
|
|
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
|
Note:
- Mandatory Traits are the minimum required for EMarketOffer to operate
- Either a single Circuit capacity OR two seasonal Circuit Capacities are mandatorily required
Input Data Structure
EMarketOffer requires input data to generate the Market Data Source for viewing historical market conditions and to create the Forecast Definitions used to generate detailed market Forecasts. Input data can be retrieved from external databases using standard SQL queries, which can be grouped together into Database Connection Configurations.
NOTE: Only one Database Connection Configuration can be in use at any one time. This "current" configuration tells EMarketOffer where to find the input data for the Market Data Source and for loading data into Forecast Definitions. The most recently used configuration is opened automatically as the default configuration on startup. The Data Sources Option in the Main Window File Menu can be used to make an alternative configuration current.
Input Data Handling Mechanism
A Configuration contains a collection of queries that may reference more than one online database. Each query can reference a single database using a pre-defined Connection containing the information required to interact with a database server; once defined a Connection can be used repeatedly by the queries in a Configuration.
The main component of a Connection is the Connection String which EMarketOffer uses to locate and connect to online database servers. The string varies in format depending on the target database server type and its specific access security provisions. It may contain:
- A data provider: this specifies the type of database server to be accessed (e.g. Oracle or MS SQL) and the specific access protocol to be used (e.g. OleDB or ODBC)
- Name of the database to be accessed (if required)
- The access parameters (typically User Name and Password)
- A Data Source Name (DSN) file containing the above information
See the section on Securing Database Access for more information on Connection Strings.
A separate query is used for each data item to be imported. Each query must be associated with a Connection and contain a standard SQL-compliant query string defining the specific data to be returned. Query strings should:
- Be tested first for syntax against your database
- Contain the return fields required by EMarketOffer
- Contain a 'Where' clause defining a select date range using the variables $DateFrom$ and $DateTo$
- Allow aliasing of column names with attribute (trait) names used by EMarketOffer
Notes:
- All queries must contain the name of the Trait on each returned row
- All queries (except for the Unit.Generator query) return a row for each Trading Period in the entered data range
WARNING! It is not possible to join data from two different databases within the same query, however EMarketOffer is designed to use a separate query for each input data item so this restriction should not constrain the program's operation. If, for any reason, you do wish to use a data item that is sourced from more than one database, you should first create a view/query in an external database that combines the required data, and then use EMarketOffer's to connect to this view.
Creating a Database Connectivity Configuration
The functions used in Configuration setup are fully described in the Menu Bar segment under the Main Window section.