Developers Getting Started With i2b2
Space shortcuts
Space Tools

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Step 6: CRC Loader properties: Configure data source lookup


During the hivedata installation one of the tables created was the CRC_DB_LOOKUP table. The CRC Loader needs to communicate with this table and in order to do this we need to tell it where to find the Hivedata tables. During this step we will define the properties for JDBC connection and the data source lookup in the following CRC Loader configuration files.

  • CRCLoaderApplicationContext.xml
  • edu.harvard.i2b2.crc.loader.properties (should still be open from previous section)

 

Prerequisite

You need to know the location of your Hivedata tables. These are owned by the PM cell.

 

Things to keep in mind when configuring the data sources in CRCLoaderApplicationContext.xml:

The following properties need to be updated or verified that they are set correctly for your environment:


"driverClassName"

  • make sure the jdbc driver is correct for the type of database you are connecting to


"url"

  • verify the jdbc is correct for your type of database
  • The correct location the database that has your hivedata tables


"username" and "password"

  • needs to match the database user you setup for your hivedata. In the i2b2 demo database this is i2b2hive and demouser.

 

Steps to update data sources in CRCLoaderApplicationContext.xml

These steps include example configurations for Oracle, PostgreSQL and SQL Server.

 

indent
Level1

1. The CRCLoaderApplicationContext.xml file is located in the following directory:

indent
Level3

YOUR_I2B2_SRC_DIR\i2b2\edu.harvard.i2b2.crc\etc\spring\

Note
titleImportant

The location shown above is written for Windows. If you are on a Linux machine the slashes in the path name need to be changed.

  • Linux Path: use a forward slash.
  • Windows Path: use a backward slash.

indent
Level2

EXAMPLES:

indent
Level3

Linux Path:  /opt/edu.harvard.i2b2.crc/etc/spring/

indent
Level3

Windows Path:  C:\opt\data\edu.harvard.i2b2.crc\etc\spring\

indent
Level1

2. Open the CRCLoaderApplicationContext.xml file to configure the data source for the CRC Loader

 

Oracle Database

 

Code Block
xml
xml
<bean id="CRCBootstrapDS" class="org.apache.commons.dbcp.BasicDataSource"
	destroy-method="close">
	<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
	<property name="url" value="jdbc:oracle:thin:@localhost:1521:XE" />
	<property name="username" value="i2b2hive" />
	<property name="password" value="demouser" />
</bean>


 

PostgreSQL Database

 

Code Block
xml
xml
<bean id="CRCBootstrapDS" class="org.apache.commons.dbcp.BasicDataSource"
	destroy-method="close">
	<property name="driverClassName" value=" org.postgresql.Driver " />
	<property name="url" value="jdbc:postgresql://localhost:5432/i2b2" />
	<property name="username" value="i2b2hive" />
	<property name="password" value="demouser" />
</bean>


 

SQL Server Database

 

Code Block
xml
xml
<bean id="CRCBootstrapDS" class="org.apache.commons.dbcp.BasicDataSource"
	destroy-method="close">
	<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
	<property name="url" value="jdbc:sqlserver://localhost:1433" />
	<property name="username" value="i2b2hive" />
	<property name="password" value="demouser" />
</bean>


indent
Level1

3. Save the changes and close the file.

 

Steps to update data sources in edu.harvard.i2b2.crc.loader.properties

These steps include example configurations for Oracle, PostgreSQL and SQL Server.

 

indent
Level1

1. Go to the edu.harvard.i2b2.crc.loader.properties file you still have opened from earlier.

indent
Level1

2. Scroll to the section called Datasource Lookup info.

indent
Level1

3. Set the Datasource Lookup information to reflect the information you entered previously in the CRCLoaderApplicationContext.xml file.

Panel
borderColor#ccc
bgColor#ffffff
titleBGColor#E5DFEC
borderStylesolid
titleDatasource Lookup info

Oracle Configuration

indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.datasource=CRCBootsrapDS

indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.servertype=ORACLE

indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.schemaname=i2b2hive


PostgreSQL Configuration
indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.datasource=CRCBootsrapDS

indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.servertype=PostgreSQL

indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.schemaname=i2b2hive


SQL Server Configuration
indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.datasource=CRCBootsrapDS

indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.servertype=SQLServer

indent
Level2

edu.harvard.i2b2.crc.loader.ds.lookup.schemaname=i2b2hive.dbo

indent
Level1

4. Save the changes and close the file.