Chapter 8. Configuration

8.1. Using Other Databases

As discussed in Section 1.3.2.1 - The EDAB Database EDAB uses a database as a persistent storage mechanism for users, groups, permissions, data sources, and published dashboards. By default, EDAB uses an HSQL database that comes with the installation. However, since this database is generally inappropriate for production environments, users can easily configure EDAB to use a different database.

8.1.1. Create Table Scripts

The first step in configuring EDAB to run with another database is to setup the tables and fields that are used to store application information. Several scripts for different databases are available in the <EDABInstallDir>/data directory. The scripts contain the create table statements for the database.

In addition to database specific scripts, a generic script is also provided that can be modified to run with other databases. The quadbasedb_jdbc.sql file contains the default scripts that are used to create the HSQL database.

8.1.1.1. Database Specific Notes

For each of the supported databases there may be a couple additional configuration steps that need to be taken to correctly setup the tables.

8.1.1.1.1. DB2

The script to create the tables for DB2 is named quadbasedb_db2.sql. For DB2 you will need to first create a TABLESPACE for the new tables. To do so, use the following steps from the command line:

  1. connect to your database using db2admin using this command:

    db2 connect to <DBNAME> user <DB2USER> using <Password>    
                        

    Be sure to substitute your database username and password when making the connection.

  2. Create buffer pool with the command below:

    db2 CREATE BUFFERPOOL BP32k SIZE 100 PAGESIZE 32k
                        
  3. Create the a tablespace with the commands below:

    db2 "CREATE REGULAR TABLESPACE DATASPACE1 PAGESIZE 32 K MANAGED BY DATABASE USING ( FILE 'c:\db2\db2data\dataspace1_01.dbf' 1000 ) EXTENTSIZE 4 OVERHEAD 10.5 PREFETCHSIZE 4 TRANSFERRATE 0.33 BUFFERPOOL BP32k"
                        
8.1.1.1.2. MS SQL Server

The script to create the tables for Microsoft SQL Server is named quadbasedb_sqlserver.sql. There is no additional setup needed to run the script for this database. However, the database connection cannot be established to SQL Server with the default settings. The requirements may vary with different SQL Server versions.

MS SQL Server 2005

Download the latest MS SQL Server 2005 JDBC Driver from: msdn.microsoft.com

Unpack the driver and copy the sqljdbc.jar file into the <EDAB>/WEB-INF/lib directory.

Recommended Admin Console entries (see Section 8.1.2 - Specifying the Database Connection):

Database URL: jdbc:sqlserver://hostname:port;databaseName=<databaseName>;
                
Database Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
                

EDAB will connect to the SQL server instance using TCP/IP protocol, so you will have to determine the TCP port number of your SQL Server instance. To do that, launch SQL Server Configuration Manager, expand the SQL Server 2005 Network Configuration node and click Protocols for <YourSQLServerInstanceName> (for example Protocols for MSSQLSERVER). Double click on the TCP/IP protocol. First of all, make sure that the TCP/IP protocol is enabled. Look at the Enabled option on the Protocol tab, it should be set to Yes, if it is not, please do so. Then look at the Listen All option, there are two possibilities:

  1. Listen All is set to Yes (default) : Go to the IP Addresses tab and scroll down to the IP All section. The port number you are looking for is below the IP All section in the TCP Dynamic Port option.

  2. Listen All is set to No : Go to the IP Addresses tab and find the section that has the IP Address option set to the IP address you will be connecting to. The port number can be found one row below the particular IP address option (TCP Dynamic Ports option).

EDAB connects to the SQL database using SQL Server Authentification mode, so you have to have this function enabled in your MS SQL Server. You can do that in MS SQL Server Management Studio. Right click on the server name in Object Explorer and click Properties. Go to the Security page and select the SQL Server and Windows Authentification mode option. Also the user that you will use to connect to the SQL Server has to have the SQL Server authentification mode set. Be sure that the user has sufficient right to use the database.

MS SQL Server 2000

Download the latest tar version of MS SQL Server 2000 JDBC Driver from: download.microsoft.com

Unpack the mssqlserver.tar file. Go to the unpacked directory and unpack the msjdbc.tar file. Go to the msjdbcd/lib directory. You should see three jar files in the lib folder. Copy them to the into the <EDAB>/WEB-INF/lib directory.

Recommended Admin Console entries (see Section 8.1.2 - Specifying the Database Connection):

Database URL: jdbc:microsoft:sqlserver://hostname:port;databaseName=<databaseName>;
                
Database Driver: com.microsoft.jdbc.sqlserver.SQLServerDriver
                
8.1.1.1.3. MySQL

The script to create the tables for MySQL is named quadbasedb_mysql.sql. There is no additional setup needed to run the script for this database.

Please, make sure that your MySQL database uses case-insensitive identifiers (see MySQL Identifier Case Sensitivity).

8.1.1.1.4. Oracle

The script to create the tables for Oracle is named quadbasedb_oracle.sql. There is no additional setup needed to run the script for this database.

8.1.2. Specifying the Database Connection

Once you have successfully created the tables in your database, you can configure EDAB to use that database for storage. To setup the database connection, log in as Admin and enter the Admin Console. There the database information can be entered under Setting InfoEDAB Repository.

Replace the URL, driver, username, and password with those for your database. EDAB uses JDBC to connect to the database, so you will need to make sure to enter the correct URL and JDBC driver class for the connection.

Once you have finished making changes, save the file. Next you will need to copy the JDBC driver for your database (typically one or several Jar files) to the <EDABInstallDir>/WEB-INF/lib directory. For application servers other than Tomcat, reference the instructions in Section 8.3 - Using Other Application Servers.

You can also specify a connection to the EDAB database using JNDI. To use the EDAB database using JNDI, you must first edit <EDABInstallDir>/WEB-INF/web.xml and uncomment the JNDI tag (remove the <!-- and --> tags). You can also change the JNDI reference name (in the <res-ref-name> tag) from jdbc/EDABdb to another name. Then log in as Admin and enter the Admin Console and pass in the JNDI details (such as JNDI context factory, JNDI provider url and JNDI name) under Setting InfoEDAB Repository. The values can be entered after the JNDI radio button is selected. Note that depending on the application server and the mapping used, the JNDI context factory and JNDI provider url may not be necessary. For example, if EDAB is installed on a Tomcat or WebSphere Application Server, connectiong to the JNDI server only requires supplying the JNDI name. For Oracle 10g, you have the choice of omitting the context factory and provider url to use the default environment, or you can specify one of context factories they provide: oracle.j2ee.rmi.RMIInitialContextFactory, oracle.j2ee.naming.ApplicationClientInitialContextFactory, or oracle.j2ee.iiop.IIOPInitialContextFactory. Due to the wide range of application servers and JNDI implementations, please see the documentation for your JNDI server for configuration options and details. When the JNDI name is specified, the database information (ulr, driver, username, password) is ignored.

With the connection information set, restart the server. The EDAB server should start connected to the new database. Note that this new database will be blank, so any information about old users, privileges, or reports and charts will not be available. In addition several key pieces of information will need to be manually setup in order to successfully deploy and run reports in EDAB with the new database.

Web Root:

You will need to enter the correct Web Root for your application server/servlet container. This information is supplied in the Admin Console. For more on this, see Section 1.4.1.2 - Setting Info.

Servlet Context:

You may need to re-set the servlet context information. For more on this, please see Section 1.4.1.2 - Setting Info.

URL Mapping:

You will need to add a virtual directory in Organizer that maps the Web path to your EDAB installation. For more information about this, see Section 2.1.5 - URL Mapping.

8.1.3. Migrating the EDAB Database

Sometimes it may be necessary to migrate the EDAB database from one platform to another. For example, initial development on an implementation may be done using EDAB in default configuration with the HSQL database. However, since HSQL is not recommended for production environments, users may need to migrate data to another database. To accomodate this, EDAB provides a database migration utility for all supported databases.

[Warning]Warning

Since version 6.3, database conversions using this tool is no longer supported. Please use the dbupgrade (DBUpgradeGUI or UpgradeAppl) program instead (Section 1.3.2.1.3 - Upgrading EDAB Database from previous version of EDAB).

Before starting the database migration process, you will have to prepare the destination database. The database has to contain empty EDAB 6.6 tables. To create the tables, run the appropriate SQL script from the <EDABInstallDir>/data directory. To learn more about the scripts, see the Section 8.1 - Using Other Databases chapter.

Please make sure that both the source and the destination databases belong to EDAB version 6.6. If not, use the dbupgrade application to fix this problem.

The program for the utility is in the <EDABInstallDir>/data/converter directory. It is a Java application that is run from the command line (the souce code is also provided). To run the converter, modify the FromDB.properties file to use the JDBC connection information for your source database. Then modify the ToDB.properties file to use the JDBC connection information for your destination database (sample connection files are provided for different databases in the directories under <EDABInstallDir>/data/converter).

At the command line, navigate to the <EDABInstallDir>/data/converter directory and execute the following command:

java -classpath ".;driver1;driver2" CopyEDABDB
        

For example:

java -classpath ".;hsqldb.jar;jdbc_mysql.jar" CopyEDABDB
        

Within the -classpath argument you will need to specify the archives/classes that contain the JDBC drivers for the source and destination databases.

Running this program will copy all data from the source (FROM) EDAB database tables to the destination (TO) EDAB database tables.

Once conversion is completed, you need to modify the database connection information in the Admin Console as described in Section 8.1.2 - Specifying the Database Connection, before restarting the server.

Please note that EDAB log records are not transferred during the database migration.