This quickstart can be found at https://learning.intersystems.com/course/view.php?name=Multimodel. It shows object, relational, and native access from a Java application to InterSystems IRIS. Airport data is stored using objects, retrieved using SQL, and a custom data structure is created using the Native API to handle route information between airports.
- For AWS, GCP, or Azure ONLY: Open multimodelQS.java and modify the IP to be "try-iris". Verify username and password as well. (Please skip this step if using InterSystems Learning Labs)
- In the integrated terminal, run the following lines to compile the classes
cd quickstarts-multimodel-java/src
javac -cp ".:../lib/intersystems-jdbc-3.0.0.jar:../lib/intersystems-xep-3.0.0.jar" multimodelQS.java - Run multimodelQS
java -cp ".:../lib/intersystems-xep-3.0.0.jar:../lib/intersystems-jdbc-3.0.0.jar" multimodelQS
- Clone the repo and open in your Java IDE
- In
multimodelQS.java, change username, password, IP, port and namespace to point to your instance of InterSystems IRIS - Run multimodelQS
If all works correctly, you will see a list of airports output. Data is stored using XEP (objects) and retrieved using JDBC (relationally).
If you would like to see how to store data natively using Java:
- Find and uncomment the following line:
// StoreAirfare(irisNative); - Enter departure airport: BOS
- Enter destination airport: AUS
The output should say:
Printed to ^AIRPORT global. The distance in miles between BOS and AUS is: 1698. This path has routes
Other routes may be null.