MetaHDBC Install

From HaskellWiki
Revision as of 19:18, 31 May 2008 by M (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This page is about installing MetaHDBC.

HDBC

MetaHDBC depends upon HDBC and HDBC-ODBC. You can install HDBC as a normal cabalized package, but for HDBC-ODBC you should do:

The patch makes it possible to call SQLDescribeParam and removes the need to execute a SQL query before getting type information.

Installing MetaHDBC

Database on Linux

To use MetaHDBC you will need a database. This section describes how to setup various databases for Linux.

DB2 Express-C

Using DB2 with MetaHDBC is attractive as DB2 supports the ODBC functions necessary for doing full type inference. The Express-C edition is also free of charge and Ubuntu makes DB2 Express-C available though their partner program.

DB2 Howto will help you install DB2. There are explanations for various flavors of Linux.

Before installing DB2 you should be given this fair warning. When I installed this .deb package, pointed to from the howto, the install script accidentally overwrote a file in /usr/include. This may or may not be true for the other types of packages pointed to from the howto.

The error is explained in more detail here.

Creating a database

To create a test database that MetaHDBC can use, do:

> su db2inst1 -l   # -l neccessary ?
> db2 create database <database name>
DB20000I  The CREATE DATABASE command completed successfully.

The database name must maximally be eight characters. Make a database called MHdbcDB2, if you want it to be usable from the MetaHDBC test programs.

UnixODBC setup

If you install the .deb package from above your /etc/odbcinst.ini should have added the following lines:

[DB2]
Description     = DB2 Driver
Driver          = /opt/ibm/db2exc/V9.5/lib32/libdb2.so
FileUsage       = 1
DontDLClose     = 1

and your /etc/odbc.ini should have this added:

[MHdbcDB2]
Description     = Test to DB2
Driver          = DB2
USER            = db2inst1
PASSWD          = <password of db2inst1 user>

The password is ibmdb2 if you have not changed it after installing DB2.

The UnixODBC.org site also has documentation for setting up ODBC for DB2.