Creating Data Sources in MINT

From IMSMA Wiki
Revision as of 10:06, 7 October 2014 by Evinek (talk | contribs)
Jump to navigation Jump to search
This page is under construction

A connection to a database (for example to the IMSMA Staging Area) is called a Data Source. The first step for getting started with MINT or lightMINT is to create a data source. The tool needs to know where the data that has to be analysed is stored. A data source can be:

  • an IMSMA staging area database
  • any other database
  • an XML or Excel file -- the preferred way however is to import or dump the content of a file in a database and then connect MINT to the database. This solution simply scales better and is better manageable. Please get in touch with your GICHD IM focal point prior to including file-based data into MINT.

Types of data sources

There are different types of data sources. The most common ones to be defined in MINT/lightMINT are the following:

  • JDBC data source: Java Database Connectivity (JDBC) is a Java-based data access technology. It allows access to relational databases, such as Postgres, MySQL, etc. For each database technology, a specific driver is needed. In both MINT and lightMINT, drivers for Postgres and MySQL are included, others might need to be installed on request.
  • JNDI data source: Java Naming and Directory Interface (JNDI) is also a Java-based technology to connect to and query data. It is defined directly on the (MINT/lightMINT) server, centrally and only once. The advantages over a JDBC connection are in maintainability and performance - JNDI manages pools of connections instead of opening many separate connections on the database if several processes are accessing the data simultaneously.
  • Virtual data source: this type of data source allows combining multiple JDBC and JNDI data sources in order to make them available through a domain. This is very useful if several databases/data sources, e.g. IMSMA and an additional source, need to be analyzed together. In such a case, it is crucial though to identify a common key that allows joining the data sets.

Create a data source

Only administrators can create data sources.

There are two easy ways of creating a data source:

  1. In MINT, in the top menu, click on Create → Data Source
  2. In MINT and lightMINT: right-click on the folder in which the data source should be stored, and choose Add Resource → Data Source

In both cases, the following page to enter the data source properties appears.

It is recommended to save all data sources in one folder, e.g. named Data Sources, in the MINT repository.

Define a JDBC data source

To define a JDBC data source, select JDBC Data Source in the Type drop-down menu. The following information then needs to be provided:

  • Name: name that allows identifying the data source
  • Resource ID: internal ID, is filled by the system but can be adapted (no special characters allowed). Once saved, the Resource ID cannot be changed.
  • Description: optional description of the data source
  • JDBC Driver: choose the appropriate driver in the drop-down list. For a connection to an IMSMA staging area, choose PostgreSQL (org.postgresql.Driver). In the case of other data source, select the corresponding driver.
  • Host: IP address of the host on which the database to connect to is running.
  • Port: port on which the database is running on the host defined above. The default port number for Postgres is 5432.
  • Database: name of the database to connect to, e.g. staging.
  • URL: this is the full URL connection to the database. It is filled automatically, in the right syntax, with the information entered above (host, port, database).
  • User Name: name of a database user that can connect to the database. For example, the user imsma can usually connect to the staging area. It is recommended though to define a read-only user on the database and use this one to connect with MINT/lightMINT.
  • Password: password of the above defined database user.
  • Time Zone: leave the default (Use database setting) - the time zone of the database is then the reference time zone.
  • Save Location: browse to a location of the MINT repository to save the data source.
The data sources are usually set up at the beginning of a MINT implementation and should not change. However, in case of doubt or if a new data source has to be created, contact your GICHD IM focal point

Define a JNDI data source

Define a Virtual data source

{{#switch:|subgroup|child=|none=|#default=

}}{{#ifeq:|Template|{{#ifeq:|child||{{#ifeq:|subgroup||{{#switch:creating data sources in mint

|doc
|sandbox
|testcases =
|#default = {{#switch:hlist
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}