Step 12: Configure the data sources
The CRC cell needs to communicate with your i2b2 database and in order to do this it needs to know where the tables for the demodata and hivedata reside. Therefore the twelfth and final step in the cell configuration process is to configure the data sources for the CRC Cell. This information is configured in the crc-ds.xml file.
Things to keep in mind when configuring your datasources:
- The demodata and hivedata tables were created during the chapter on Data Installation.
- The CRCBootStrapDS points to the data source for your CRC_DB_LOOKUP table which is a hivedata table.
- The <user-name> and <password> need to match the database user you set up for your hivedata. In the i2b2 demo database this is i2b2hive and demouser.
- The QueryToolDemoDS points to the data source for your demodata tables.
- The <user-name> and <password> need to match the database user you set up for your demodata. In the i2b2 demo database this is i2b2demodata and demouser.
- The <connection_url> needs to have the following:
- The correct JDBC information for your type of database.
- The correct location of the database containing your crcdata or hivedata tables. (These may or may not reside in the same location)
- Both the <driver-class> and <driver> need to accurately reflect the type of database you are connecting to.
Steps to configure data sources
The following steps define how to configure your data sources for the CRC Cell. These steps include example configurations for Oracle, PostreSQL and SQL Server.
Oracle Database
<datasource jta="false" jndi-name="java:/CRCBootStrapDS" pool-name="CRCBootStrapDS" 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:/QueryToolDemoDS" pool-name="QueryToolDemoDS" 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>i2b2demodata</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
<datasource jta="false" jndi-name="java:/CRCBootStrapDS" pool-name="CRCBootStrapDS" 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:/QueryToolDemoDS" pool-name="QueryToolDemoDS" 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>i2b2demodata</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
<datasource jta="false" jndi-name="java:/CRCBootStrapDS" pool-name="CRCBootStrapDS" 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:/QueryToolDemoDS" pool-name="QueryToolDemoDS" 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>i2b2demodata</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>
Second Data Source Configuration
<datasource jta="false" jndi-name="java:/QueryToolDemoDS" pool-name="QueryToolDemo2DS" 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>i2b2demodata2</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>
Note
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.