This article describes how the universal database connector for Meisterplan works, how to integrate it under Manage > Data Sources in Meisterplan, how to download and set it up using the associated xml configuration file and how to run it.
- Adding a Universal Database Connector Data Source in Meisterplan
- Configuring the Connector
- Configuring the Connection Details
- Writing Custom SQL Queries
- Adding a JDBC Driver
- Running the Connector
- Other Command Line Arguments
With the Meisterplan universal database connector, you can import your project and resource data from any JDBC compatible database into Meisterplan.
The connector comes as a standalone Java program in the .jar-Format. To run the program, you must first take the preliminary steps explained in the following sections.
The universal database connector comes as a Java program and therefore requires the Java Runtime. See the Client System Requirements article for the currently required version.
Adding a Universal Database Connector Data Source in Meisterplan
To import the data read from the JDBC data source to Meisterplan, you need to add a universal database connector data source in Meisterplan:
- In the left hand side sidebar, under Manage, open the Data Sources view.
- Click the Add Data Source button to open the selection of available data sources.
- Select Universal Database Connector to add a universal database connector data source.
- Enter the following settings and download the current version of the Java executable for the universal database connector via the download link displayed here.
Name: the default name for universal database connectors is "Universal Database Connector". Rename the connector to indicate the data source you wish to connect.
Import-Code and URL: your import code for the webservice, which the universal database connector uses to import data into Meisterplan, and the URL to access the webservice. You will need to enter the import code and URL for the webservice into the configuration XML file used by the universal database connector, as is described in the Configuring the Connection Details section below.
Download: download link to the universal database connector Java executable.
Configuring the Connector
The universal database connector is configured via an XML file that stores connection details and custom queries. To generate a template XML configuration file, you can execute the following command in the directory where the connector executable file is located:
java -jar mp-jdbcconnector-[version].jar --generate-default-config config.xml
This will generate a config.xml file. Enter the following information in this file in order to import the data into Meisterplan:
- The credentials for querying the Meisterplan webservice
- Your custom SQL queries for collecting the data
- The JDBC driver class
- The location of your JDBC compatible database
Configuring the Connection Details
<connector>-Tag of the configuration file keeps information about the Meisterplan Webservice.
url and the
importCode properties can be obtained by opening the Universal Database Connector properties under Manage > Data Sources in Meisterplan.
Please note that you may also pass the password as a command line parameter. This will overwrite the password stored in the XML file, such that you don't have to store the actual password in the XML file. See the Other Command Line Arguments section below for information about displaying supported command line arguments.
Writing Custom SQL Queries
In order to bring your data into the format that Meisterplan expects, you need to write custom SQL queries and enter them in the XML configuration. The expected column names can be seen in the template configuration, that can be generated as described above. Here is a small example query that shows the selection of project data using the SQL AS keyword:
SELECT proj.mycode AS code, proj.mytitle AS title, proj.start, proj.finish,
proj.managerid, proj.status, proj.costtype, proj.priority, prog.code AS
programcode, goal.code AS businessgoalcode, proj.mynotescolumn AS notes
FROM project proj, programs prog, businessgoals goal
WHERE proj.mycode = prog.mycode AND proj.mycode = goal.mycode
Adding a JDBC driver
In order to query your JDBC database, a JDBC driver must be specified in the configuration file. You can download the required driver on the homepage of your database manufacturer.
In the configuration XML, you need to specify the fully qualified Java class name of the driver and the JDBC connection String. The code-block below shows an example how the Configuration XML tags look like for a PostgreSQL database:
Please note that you may also pass the password as a command line parameter. This will overwrite the password stored in the XML file, such that you don't have to store the actual password in the XML file. See Other Command Line Arguments below for information about displaying supported command line arguments.
For the most popular database systems, the following table provides an overview about the name of the driver class and the download location:
|Database||Driver-Class||Download of the JDBC driver jar|
|Microsoft SQL Server||com.microsoft.sqlserver.jdbc.SQLServerDriver||https://www.microsoft.com/download/details.aspx?id=11774|
Running the Connector
To execute the connector, the JDBC driver must be available in the classpath of the program. To achieve this, the driver's .jar-file must be passed with the command line arguments.
Here is an example how to run the connector using the PostgreSQL JDBC driver .jar file and the config.xml configuration file:
java -cp "postgresql-9.4.1208.jar;mp-jdbcconnector-[version].jar"
de.itdesign.meisterplan.connector.impl.jdbc.EntryPoint -c config.xml
Other Command Line Arguments
A list of all available command line arguments can be obtained by executing
java -jar mp-jdbcconnector-[version].jar --help