Metatude
Company Solutions Value Added Partners Stakeholder Feedback Support Contact us
You are at:   Metatude index    Support    Connections    JDBC
JDBC

JDBC Connections


Various databases ship with JDBC drivers. You can use these drivers to connect a database to the Metatude suite. At this moment, Metatude software ships with JDBC drivers for Oracle and PostgreSQL databases. Below you find a description of how to connect these two databases, using the Project Manager. Then, an overview of how to install and use third party JDBC drivers for connecting other databases to the Metatude suite is presented. Please note that third party drivers have not been tested extensively, and therefore are not supported.

Connect a database using shipped JDBC drivers
Open the Project Manager and go to the 'Dir servers' tab. Click on the 'Add server' button. Here you can fill out the information for connecting to a database.


Add/Edit directory/database server in the Project Manager

Choose JDBC as protocol. Please note that the Driver name and URL are case sensitive

Oracle Database with thin driver:
Driver: Fill out oracle.jdbc.driver.OracleDriver here.
URL: The URL is as folows: jdbc:oracle:thin:@hostname:port:DatabaseName
The hostname can also be an IP adress. If you called the database StakeholderDB and it is running on port 1521 on a machine with IP adress 192.168.84.16, the url is:
jdbc:oracle:thin:@192.168.84.16:1521:StakeholderDB.
The thin driver has the advantage that it's a type 4 driver. No additional drivers or other components need to be installed on the Dialogue Server in order to connect to an Oracle database.
However, you need to configure the Oracle server with a TCP/IP Listener.

Oracle Database with OCI client side driver:
Driver: Fill out oracle.jdbc.driver.OracleDriver here.
URL: The URL is as folows: jdbc:oracle:oci8:@Net_Service_Name
Net_service_name: This driver needs a "connect string" that identifies the JDBC driver to use and the database to connect to. For the JDBC OCI driver, the database can be specified by a TNSNAMES entry; this is one of the database names you use from SQL*Plus. The available TNSNAMES entries are listed in the file [ORACLE_HOME]/network/admin/tnsnames.ora on the client computer you are connecting from (the Metatude Dialogue Server).
For example, if you want to connect to the database "StakeholderDB” the URL should be:
jdbc:oracle:oci8:@StakeholderDB
Note that the ":" and "@" characters are both necessary for both drivers (thin and OCI).
Oracle's JDBC OCI drivers are Type 2 JDBC drivers which use native methods so the driver, native executables and Oracle client must be pre-installed on the Dialogue Server. This driver can access Oracle8.0.4 and higher servers. The JDBC OCI driver requires an Oracle7.3.4 (or better) client installation (including SQL*Net v2.3 or better) and all other dependent files.

PostgreSQL database:
Driver: Fill out org.postgresql.Driver here.
URL: The URL is as folows: jdbc:postgresql://hostname:port/DatabaseName
The hostname can also be an IP adress. The port number only has te be given when it is another value than the default value. So if you called the database StakeholderDB and it is running on a machine with IP adress 192.168.84.16, the url is
jcbc:postgresql://192.168.84.16/StakeholderDB
If the PostgeSQL database is on the same server as the Metatude Dialogue Server, then you can use the following url: jdbc:postgresql:DatabaseName

ODBC database:
If you connect a database using ODBC, you have to fill out the folowing:
Driver: Fill out sun.jdbc.odbc.JdbcOdbcDriver here.
URL: The URL is as folows: jdbc:odbc:Name
Here Name is the name you have given to your ODBC connection. See the section about ODBC to learn more.

You now have to fill out the table in the database that holds the stakeholder information and the username and password (if any) for connecting to the database.

Next, click on the tab 'Attributes' to define wich collumn in the table holds what information. Read the manual for the Project Manager to learn more.

Installing and using third party JDBC drivers
The installation of third party drivers can be done in a couple of different ways. The most easy way is to install the drivers in the 'lib/ext' directory of the JRE that the Metatude Dialogue Server is using. Native type 4 Microsoft SQL server JDBC drivers can be found by following this link. These drivers can be used to connect to a Microsoft SQL Server 2000 from Linux. Unfortunately, the licence of these drivers prohibits us from shipping them directly with our software. However, you can use them freely if you own any Microsoft SQL Server license.

Installing JDBC drivers on a Windows OS:
If you installed the Metatude Dialogue Server (MDS) with default options in the installer, then the MDS resides on your harddrive in the directory 'C:\Program Files\Metatude\MDS'. A Java Runtime Environment (JRE) is also installed when installing the MDS. This is installed to 'C:\Program Files\jre' per default. To install a JDBC driver, you have to create a directory called 'ext' (without quotes) in the directory 'C:\Program Files\jre\lib\'. You then have to copy the JDBC drivers to this newly created directory ('C:\Program Files\jre\lib\ext'). The JDBC drivers for a database are usually one or a few files that can be recognized by the extension '.jar'. You now have to restart the MDS. The installed drivers will now automatically be found and can be used directly.

Installing JDBC drivers on Unix OS'ses:
The Metatude Dialogue Server (MDS) is installed in /home/metatude/MDS' per default. A Java Runtime Environment (JRE) is installed in '/home/metatude/jre' per default. To install the JDBC drivers you just have to copy them to '/home/metatude/jre/lib/ext'. The JDBC drivers for a database are usually one or a few files that can be recognized by the extension '.jar'. You now have to restart the MDS. The installed drivers will now automatically be found and can be used directly.

Please see the manual of your JDBC drivers to find out what values have to be filled out in the Driver:, URL:, User: and Password: fields when adding a new JDBC connection using the Project Manager and third party drivers.




Copyright 2010 Metatude BV. All rights reserved.