Step 6: Configure the data sources for the Workplace Cell

The Workplace cell needs to communicate with your i2b2 database and in order to do this it needs to know where the tables for the workdata and hivedata reside. Therefore the sixth and final step in the cell configuration process is to configure the data sources for the Workplace Cell. This information is configured in the work-ds.xml file.


Things to keep in mind when configuring your datasources:








Steps to configure data sources


The following steps define how to configure your data sources for the Workplace Cell. These steps include example configurations for Oracle, PostreSQL and SQL Server.


1. The work-ds.xml file is located in the following directory:

YOUR_I2B2_SRC_DIR\edu.harvard.i2b2.workplace\etc\jboss


2. Open the work-ds.xml file to configure your data sources. (see examples shown below)



Oracle Database Configuration


<datasource jta="false" jndi-name="java:/WorkplaceBootStrapDS"
		pool-name="WorkplaceBootStrapDS" enabled="true" use-ccm="false">
	<connection-url>jdbc:oracle:thin:@localhost:1521:xe</connection-url>
	<driver-class>oracle.jdbc.OracleDriver</driver-class>
	<driver>ojdbc6.jar</driver>
	<security>
		<user-name>i2b2hive</user-name>
		<password>demouser</password>
	</security>
	<validation>
		<validate-on-match>false</validate-on-match>
		<background-validation>false</background-validation>
	</validation>
	<statement>
		<share-prepared-statements>false</share-prepared-statements>
	</statement>
</datasource>
<datasource jta="false" jndi-name="java:/WorkplaceDemoDS"
	pool-name="WorkplaceDemoDS" enabled="true" use-ccm="false">
	<connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
	<driver-class>oracle.jdbc.OracleDriver</driver-class>
	<driver>ojdbc6.jar</driver>
	<security>
		<user-name>i2b2workdata</user-name>
		<password>demouser</password>
	</security>
	<validation>
		<validate-on-match>false</validate-on-match>
		<background-validation>false</background-validation>
	</validation>
	<statement>
		<share-prepared-statements>false</share-prepared-statements>
	</statement>
</datasource>



PostgreSQL Database Configuration


<datasource jta="false" jndi-name="java:/WorkplaceBootStrapDS"
		pool-name="WorkplaceBootStrapDS" enabled="true" use-ccm="false">
	<connection-url>jdbc:postgresql://localhost:5432/i2b2</connection-url>
	<driver-class>org.postgresql.Driver</driver-class>
	<driver>postgresql-9.2-1002.jdbc4.jar</driver>
	<security>
		<user-name>i2b2hive</user-name>
		<password>demouser</password>
	</security>
	<validation>
		<validate-on-match>false</validate-on-match>
		<background-validation>false</background-validation>
	</validation>
	<statement>
		<share-prepared-statements>false</share-prepared-statements>
	</statement>
</datasource>
<datasource jta="false" jndi-name="java:/WorkplaceDemoDS"
	pool-name="WorkplaceDemoDS" enabled="true" use-ccm="false">
	<connection-url>jdbc:postgresql://localhost:5432/i2b2</connection-url>
	<driver-class>org.postgresql.Driver</driver-class>
	<driver>postgresql-9.2-1002.jdbc4.jar</driver>
	<security>
		<user-name>i2b2workdata</user-name>
		<password>demouser</password>
	</security>
	<validation>
		<validate-on-match>false</validate-on-match>
		<background-validation>false</background-validation>
	</validation>
	<statement>
		<share-prepared-statements>false</share-prepared-statements>
	</statement>
</datasource>



SQL Server Database Configuration


<datasource jta="false" jndi-name="java:/WorkplaceBootStrapDS"
		pool-name="WorkplaceBootStrapDS" enabled="true" use-ccm="false">
	<connection-url>jdbc:sqlserver://localhost:1433</connection-url>
	<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
	<driver>sqljdbc4.jar</driver>
	<security>
		<user-name>i2b2hive</user-name>
		<password>demouser</password>
	</security>
	<validation>
		<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"></valid-connection-checker>
		<validate-on-match>false</validate-on-match>
	</validation>
	<statement>
		<share-prepared-statements>false</share-prepared-statements>
	</statement>
</datasource>
<datasource jta="false" jndi-name="java:/WorkplaceDemoDS"
	pool-name="WorkplaceDemoDS" enabled="true" use-ccm="false">
	<connection-url>jdbc:sqlserver://localhost:1433</connection-url>
	<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
	<driver>sqljdbc4.jar</driver>
	<security>
		<user-name>i2b2workdata</user-name>
		<password>demouser</password>
	</security>
	<validation>
		<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"></valid-connection-checker>
		<validate-on-match>false</validate-on-match>
	</validation>
	<statement>
		<share-prepared-statements>false</share-prepared-statements>
	</statement>
</datasource>



3. If your environment has multiple projects pointing to different data sources then copy the <datasource> section for each project data source.

4. Update the jndi-name and pool-name to reflect the name of the second project .

Example:   A second project called Demo2 would have the following entry:


Second Data Source Configuration


<datasource jta="false" jndi-name="java:/WorkplaceDemo2DS"
	pool-name="WorkplaceDemo2DS" enabled="true" use-ccm="false">
	<connection-url>jdbc:oracle:thin:@localhost:1521:xe</connection-url>
	<driver-class>oracle.jdbc.OracleDriver</driver-class>
	<driver>ojdbc6.jar</driver>
	<security>
		<user-name>i2b2workdata</user-name>
		<password>demouser</password>
	</security>
	<validation>
		<validate-on-match>false</validate-on-match>
		<background-validation>false</background-validation>
	</validation>
	<statement>
		<share-prepared-statements>false</share-prepared-statements>
	</statement>
</datasource>



The above example is for an Oracle database. If your database is SQL Server or PostgreSQL then you will need to copy the <datasource> section for your type database connection. Do not use this one as it will not work.



5. Save the changes and close the file.