Skip to content

Commit d4dc8a5

Browse files
authored
Introduce support for InterSystems IRIS (#2416)
1 parent 3114701 commit d4dc8a5

File tree

9 files changed

+88
-8
lines changed

9 files changed

+88
-8
lines changed

pom.xml

+16-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
<circe.version>1.12.0</circe.version>
3232
<jersey.version>2.14</jersey.version>
33-
<SqlRender.version>1.16.1</SqlRender.version>
33+
<SqlRender.version>1.19.1</SqlRender.version>
3434
<hive-jdbc.version>3.1.2</hive-jdbc.version>
3535
<pac4j.version>4.0.0</pac4j.version>
3636
<jackson.version>2.12.7</jackson.version>
@@ -200,7 +200,7 @@
200200
<server.ssl.key-password></server.ssl.key-password>
201201
<server.servlet.context-path>/WebAPI</server.servlet.context-path>
202202

203-
<arachne.version>1.17.3</arachne.version>
203+
<arachne.version>1.17.4</arachne.version>
204204
<jersey-media-multipart.version>2.25.1</jersey-media-multipart.version>
205205
<execution.invalidation.period>600000</execution.invalidation.period>
206206
<execution.invalidation.maxage.hours>12</execution.invalidation.maxage.hours>
@@ -1859,6 +1859,20 @@
18591859
</dependency>
18601860
</dependencies>
18611861
</profile>
1862+
<profile>
1863+
<id>webapi-iris</id>
1864+
<properties>
1865+
<iris.enabled>true</iris.enabled>
1866+
<iris.driver.version>3.10.2</iris.driver.version>
1867+
</properties>
1868+
<dependencies>
1869+
<dependency>
1870+
<groupId>com.intersystems</groupId>
1871+
<artifactId>intersystems-jdbc</artifactId>
1872+
<version>${iris.driver.version}</version>
1873+
</dependency>
1874+
</dependencies>
1875+
</profile>
18621876
<profile>
18631877
<id>webapi-gis</id>
18641878
<properties>

src/main/extras/iris/README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Using WebAPI with InterSystems IRIS support
2+
3+
## Building WebAPI
4+
5+
To build WebAPI with InterSystems IRIS support, you can simply use the `webapi-iris` profile
6+
when building WebAPI with Maven:
7+
8+
```Shell
9+
mvn -Pwebapi-postgresql,webapi-iris clean package
10+
```
11+
12+
or on Windows PowerShell:
13+
```Shell
14+
mvn "-Pwebapi-postgresql,webapi-iris" clean package
15+
```
16+
17+
This will automatically download and package a recent version of the InterSystems IRIS JDBC
18+
driver from Maven Central.
19+
20+
Alternatively, the JDBC driver for InterSystems IRIS can be found in the `dev/java/lib/1.8/`
21+
subfolder of your IRIS installation, or as a download from InterSystems Cloud Services portal.
22+
23+
24+
## Sample configuration
25+
26+
When configuring Atlas / WebAPI to access CDM on IRIS over a secure connection, your source
27+
registration looks like this:
28+
```SQL
29+
INSERT INTO webapi.source (source_id, source_name, source_key, source_connection, source_dialect, username, password)
30+
VALUES (<#>, 'OHDSI IRIS Database', 'IRIS', 'jdbc:IRIS://<hostname>.elb.us-west-2.amazonaws.com:443/USER/:::true',
31+
'iris', '<username>','<password>');
32+
```
33+
34+
For a non-encrypted, local connection, this may look like:
35+
```SQL
36+
INSERT INTO webapi.source (source_id, source_name, source_key, source_connection, source_dialect, username, password)
37+
VALUES (<#>, 'OHDSI IRIS Database', 'IRIS', 'jdbc:IRIS://localhost:1972/USER/', 'iris', '_SYSTEM_','SYS');
38+
```
39+
40+
41+
## References
42+
43+
For more information on how to connect to InterSystems IRIS or InterSystems IRIS Cloud SQL, please see:
44+
* [Connecting your applications to Cloud SQL](https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GDRIVE_cloudsql)
45+
* [Troubleshooting connection issues](https://docs.intersystems.com/services/csp/docbook/DocBook.UI.Page.cls?KEY=ACTS)
46+
* [InterSystems fork for OHDSI Broadsea](https://github.com/isc-krakshith/InterSystems-Broadsea/)

src/main/java/org/ohdsi/webapi/DataAccessConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public DataSource primaryDataSource() {
8282
//note autocommit defaults vary across vendors. use provided @Autowired TransactionTemplate
8383

8484
String[] supportedDrivers;
85-
supportedDrivers = new String[]{"org.postgresql.Driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "oracle.jdbc.driver.OracleDriver", "com.amazon.redshift.jdbc.Driver", "com.cloudera.impala.jdbc.Driver", "net.starschema.clouddb.jdbc.BQDriver", "org.netezza.Driver", "com.simba.googlebigquery.jdbc42.Driver", "org.apache.hive.jdbc.HiveDriver", "com.simba.spark.jdbc.Driver", "net.snowflake.client.jdbc.SnowflakeDriver", "com.databricks.client.jdbc.Driver"};
85+
supportedDrivers = new String[]{"org.postgresql.Driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "oracle.jdbc.driver.OracleDriver", "com.amazon.redshift.jdbc.Driver", "com.cloudera.impala.jdbc.Driver", "net.starschema.clouddb.jdbc.BQDriver", "org.netezza.Driver", "com.simba.googlebigquery.jdbc42.Driver", "org.apache.hive.jdbc.HiveDriver", "com.simba.spark.jdbc.Driver", "net.snowflake.client.jdbc.SnowflakeDriver", "com.databricks.client.jdbc.Driver", "com.intersystems.jdbc.IRISDriver"};
8686
for (String driverName : supportedDrivers) {
8787
try {
8888
Class.forName(driverName);

src/main/java/org/ohdsi/webapi/util/CancelableJdbcTemplate.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ private boolean supportsBatchUpdates(Connection connection) throws SQLException
156156

157157
// NOTE:
158158
// com.cloudera.impala.hivecommon.dataengine.HiveJDBCDataEngine.prepareBatch throws NOT_IMPLEMENTED exception
159-
return JdbcUtils.supportsBatchUpdates(connection) && !connection.getMetaData().getURL().startsWith("jdbc:impala");
159+
return JdbcUtils.supportsBatchUpdates(connection)
160+
&& !connection.getMetaData().getURL().startsWith("jdbc:impala")
161+
&& !connection.getMetaData().getURL().startsWith("jdbc:IRIS");
160162
}
161163
}

src/main/resources/i18n/messages_en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2678,7 +2678,8 @@
26782678
"sqlserver": "SQL server",
26792679
"synapse": "Azure Synapse",
26802680
"snowflake": "Snowflake",
2681-
"spark": "Apache Spark"
2681+
"spark": "Apache Spark",
2682+
"iris": "InterSystems IRIS"
26822683
},
26832684
"title": "Source dialect"
26842685
},

src/main/resources/i18n/messages_ko.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2620,7 +2620,8 @@
26202620
"sqlserver": "SQL server",
26212621
"synapse": "Azure Synapse",
26222622
"snowflake": "Snowflake",
2623-
"spark": "Apache Spark"
2623+
"spark": "Apache Spark",
2624+
"iris": "InterSystems IRIS"
26242625
},
26252626
"title": "소스 dialect"
26262627
},

src/main/resources/i18n/messages_ru.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2534,7 +2534,8 @@
25342534
"hive": "Hive LLAP",
25352535
"synapse": "Azure Synapse",
25362536
"snowflake": "Snowflake",
2537-
"spark": "Apache Spark"
2537+
"spark": "Apache Spark",
2538+
"iris": "InterSystems IRIS"
25382539
}
25392540
},
25402541
"connectionString": {

src/main/resources/i18n/messages_zh.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2620,7 +2620,8 @@
26202620
"sqlserver": "SQL服务器",
26212621
"synapse": "Azure Synapse",
26222622
"snowflake": "Snowflake",
2623-
"spark": "Apache Spark"
2623+
"spark": "Apache Spark",
2624+
"iris": "InterSystems IRIS"
26242625
},
26252626
"title": "源语言"
26262627
},

src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java

+14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class DataSourceDTOParserTest {
2929
public static final String ORACLE_WO_PWD_CONN_STR = "jdbc:oracle:thin:@myhost:1521:orcl";
3030
public static final String ORACLE_WITH_PWD_CONN_STR = "jdbc:oracle:thin:scott/tiger@myhost:1521:orcl";
3131
public static final String HIVE_CONN_STR = "jdbc:hive2://sandbox-hdp.hortonworks.com:2181/synpuf_531_orc;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2";
32+
public static final String IRIS_CONN_STR = "jdbc:IRIS://localhost:1972/USER";
3233

3334
@Test
3435
public void parseDTO() {
@@ -110,6 +111,12 @@ public void parseDTO() {
110111
assertThat(dto.getConnectionString(), is(HIVE_CONN_STR));
111112
assertThat(dto.getUsername(), is(nullValue()));
112113
assertThat(dto.getPassword(), is(nullValue()));
114+
115+
dto = DataSourceDTOParser.parseDTO(getIRISSource());
116+
assertThat(dto.getType(), is(DBMSType.IRIS));
117+
assertThat(dto.getConnectionString(), is(IRIS_CONN_STR));
118+
assertThat(dto.getUsername(), is(nullValue()));
119+
assertThat(dto.getPassword(), is(nullValue()));
113120
}
114121

115122
private Source getPostgreSQLPasswordSource() {
@@ -204,4 +211,11 @@ private Source getHiveSource() {
204211
source.setSourceConnection(HIVE_CONN_STR);
205212
return source;
206213
}
214+
215+
private Source getIRISSource() {
216+
Source source = new Source();
217+
source.setSourceDialect("iris");
218+
source.setSourceConnection(IRIS_CONN_STR);
219+
return source;
220+
}
207221
}

0 commit comments

Comments
 (0)