Adding a database
Previous  Top  Next


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, IBM DB2, Microsoft SQL Server and PostgreSQL databases. Below you find a description of how to connect these two databases. You can connect to other databases through ODBC. If you use an ODBC connection to a database, you will have to make use of the JDBC-ODBC driver that is shipped with the Metatude software. At the end of this chapter, 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.

The Metatude software supports three different charactersets. These are ISO-8859-1 for western European languages and UTF-8 and UCS-2 for all languages. Your stakeholder database should be encoded using one of these charachtersets or an alias or subset. If you use ODBC for connecting to a database, then the system automatically switches to the ISO-8859-1 characterset. You cannot use an Unicode database (UTF-8 or UCS-2) when using ODBC.

Connect a database using shipped JDBC drivers

dirserver_jdbc
Figure 7: Adding a new directory step 1: Details of the database

Important:
The values you fill out in the Driver: fields are Case-Sensitive
, and have to be filled out in the correct case.

All URLs that you fill out are relative to the location of the Metatude Dialogue Server (MDS). This means that if you connect to a database that resides on the MDS you can use 'localhost' as the hostname. Also the MDS needs to be able to connect to the stakeholder databases using TCP/IP in case of a JDBC connection or ODBC in case of an ODBC connection.

General information:
·Name: The name that you wish to give this connection  
·Protocol: Choose JDBC  
·Table: the name of the table in the database with the relevant information  
·User: the username to access the database.  
·Password: the password to access the database.  


Oracle Database:
·Driver: Fill out oracle.jdbc.driver.OracleDriver here (case sensitive).  
·URL: The URL is as folows: jdbc:oracle:thin:@<hostname>:<port>:<database name>  
·Table: The table name needs to be entered in all UPPERCASE characters  

The hostname can also be an IP adress. If you called the database StakeholderDB and it is running on port 1521 (the default Oracle port) on a machine with IP adress 192.168.84.16, the url is: jdbc:oracle:thin:@192.168.84.16:1521:StakeholderDB.


Microsoft SQL Server database:
·Driver: Fill out com.microsoft.jdbc.sqlserver.SQLServerDriver here (case sensitive).  
·URL: The URL is as folows: jdbc:microsoft:sqlserver://<hostname>:<Port>;databaseName=<database name>;selectMethod=cursor  

The hostname can also be an IP adress. The default port number for Microsoft SQL Server is 1433. So if you called the database StakeholderDB and it is running on a machine with IP adress 192.168.84.16, the url is jdbc:microsoft:sqlserver://192.168.84.16:1433;databaseName=StakeholderDB;selectMethod=cursor

Please note that you cannot use Windows authentication to connect to an SQL Server database. You need to acces any SQL Server database using SQL Server authentication. If your SQL Server is not installed to use SQL Server authentication, then you can try to use ODBC to connect to this database (see below).


IBM DB2 database:
·Driver: Fill out com.ibm.db2.jcc.DB2Driver here (case sensitive).  
·URL: The URL is as folows: jdbc:db2://<hostname>:<port>/<database name>  

The hostname can also be an IP adress. The default port number for IBM DB2 is 50000. So if you called the database StakeholderDB and it is running on a machine with IP adress 192.168.84.16, the url is jdbc:db2://192.168.84.16:50000/StakeholderDB


PostgreSQL database:
·Driver: Fill out org.postgresql.Driver here (case sensitive).  
·URL: The URL is as folows: jdbc:postgresql://<hostname>:<port>/<database name>  

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, which is 5432. So if you called the database StakeholderDB and it is running on a machine with IP adress 192.168.84.16, the url is jdbc:postgresql://192.168.84.16:5432/StakeholderDB


Other ODBC databases:
First, create an ODBC connection to your database, then fill out the folowing information:
·Driver: Fill out sun.jdbc.odbc.JdbcOdbcDriver here (case sensitive).  
·URL: The URL is as folows: jdbc:odbc:Name  

Here Name is the name you have given to your ODBC connection.


Summary:

Database type:
Oracle
Driver:
oracle.jdbc.driver.OracleDriver
URL:
jdbc:oracle:thin:@<hostname>:<port>:<database name>


Database type:
Microsoft SQL Server
Driver:
com.microsoft.jdbc.sqlserver.SQLServerDriver
URL:
jdbc:microsoft:sqlserver://<hostname>:<Port>;
databaseName=<database name>;selectMethod=cursor


Database type:
IBM DB2
Driver:
com.ibm.db2.jcc.DB2Driver
URL:
jdbc:db2://<hostname>:<port>/<database name>


Database type:
PostgreSQL
Driver:
org.postgresql.Driver
URL:
jdbc:postgresql://<hostname>:<port>/<database name>


Database Type:
ODBC
Driver:
sun.jdbc.odbc.JdbcOdbcDriver
URL:
jdbc:odbc:<connection name>


After you have provided this data and click the button Next, the application tries to connect to the database. When this succeeds, the second step of the wizard will show a list of the attributes stored in the database.


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\Metatude Dialogue Server. A Java Runtime Environment (JRE) is also installed when installing the MDS. This is installed to C:\Program Files\Metatude\Metatude Dialogue Server'\jre per default. To install a JDBC driver, you have to create a directory called ext in the directory C:\Program Files\Metatude\Metatude Dialogue Server'\jre\lib\. You then have to copy the JDBC drivers to this newly created directory (C:\Program Files\Metatude\Metatude Dialogue Server'\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 uses the same method as described for a Windows OS. The default installation of the MDS resides in /opt/mds.