This is a simple hello world example to show a JDBC connection to InterSystems IRIS. For more information about using this sample, please see documentation.
- Open Samples-java-helloworld/Simple/HelloWorld.java
- Comment out line 4 (since we won't need the package declaration here)
//package com.intersystems.samples; - For AWS, GCP, or Azure ONLY: Edit line 14 to change the ip to "try-iris" (Please skip this step if using InterSystems Learning Labs)
- In the terminal window type:
cd Samples-java-helloworld/simple
javac -cp ".:intersystems-jdbc-3.0.0.jar" HelloWorld.java
java -cp ".:intersystems-jdbc-3.0.0.jar" HelloWorld
- Clone this repo
- Open the repo in your favorite Java IDE (such as Eclipse, IntelliJ, or NetBeans)
- Open Samples-java-helloworld/simple/HelloWorld.java and verify ip, password, port, and username are right. Update as necessary.
- Set up a classpath to intersystems-jdbc-3.0.0.jar
- Run HelloWorld.java