Child pages
  • Database Drivers

Contents

Overview

If you plan to load data from a database or from a data warehouse into BayesiaLab, you will first need to install the necessary database drivers. These drivers are typically provided by the respective database vendor. The following example shows how to connect to a MySQL database running on localhost.

Instructions

From BayesiaLab's start screen, select Data>Open Data Source>Database

If no previous connection is defined, the Data Import Wizard will initially appear blank.

Clicking   opens the list of currently installed drivers:

If the required driver is listed as not available, and thus grayed out, you will need to download the driver from the database vendor. In our example, the appropriate driver for MySQL is mm-mysql-2.0.7.jar.

  • For Mac OS X installations, we need to place mm-mysql-2.0.7.jar file into /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
  • In a Windows environment, we would put mm-mysql-2.0.7.jar into C:\Program Files\Bayesia\BayesiaLab\jre1.6\lib\ext. The specific file path on your system is obviously dependent on where you have installed BayesiaLab. 

Once the driver file is put into place, please restart BayesiaLab and repeat steps 1 through 3. After clicking Search Available Drivers, the relevant driver will appear in the Driver List:

Click Select and you will proceed to the next step of the Data Import Wizard, which enables you to connect to your database using your credential.

Upon successful connection to the database server, the available database will appear under Catalog. Select the database, click Apply and the drop-down menu of Tables will appear. Each table's fields can then be highlighted and selected to form a query. Upon selection, BayesiaLab will provide a data preview. 

Clicking  opens up a larger window, which provides an opportunity to enter longer SQL statements. 

The elements in the lower portion of the dialogue box,

are identical to what is explained in the Data Import Wizard for flat files (read more).

Clicking  concludes the database-specific portion of the import process.