Merge pull request #3 from intersystems/local-instructions-readme

Add instructions to run locally
This commit is contained in:
DuongDo-Intersystems 2019-04-01 11:33:50 -04:00 committed by GitHub
commit 153fc9c000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 10 deletions

View File

@ -1,12 +1,18 @@
# Samples-java-helloworld # Samples-java-helloworld
Simple hello world code to show a Java connection to InterSystems IRIS 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](https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AB_idesetup).
## To run this code in provided Theia IDE ## To run this code in InterSystems Learning Labs, AWS, GCP, or Azure
1. Open Samples-java-helloworld/Simple/HelloWorld.java
Edit Samples-java-helloworld/Simple/HelloWorld.java: 2. Comment out line 4 (we won't need the package declaration here)
1. comment out line 4 as we won't need the package declaration 3. Edit line 14 to change the ip to "try-iris"
2. edit line 14 to change the ip to "try-iris" 4. In the terminal window type:
In the terminal window type: `cd Samples-java-helloworld/simple`
`cd Samples-java-helloworld/Simple` `javac -cp ".:intersystems-jdbc-3.0.0.jar" HelloWorld.java`
`javac -cp ".:intersystems-jdbc-3.0.0.jar" HelloWorld.java` `java -cp ".:intersystems-jdbc-3.0.0.jar" HelloWorld`
`java -cp ".:intersystems-jdbc-3.0.0.jar" HelloWorld`
## To run this code locally
1. Clone this repo
2. Open the repo in your favorite Java IDE (such as Eclipse, IntelliJ, or NetBeans)
3. Open Samples-java-helloworld/simple/HelloWorld.java and verify ip, password, port, and username are right. Update as necessary.
4. Set up a classpath to intersystems-jdbc-3.0.0.jar
5. Run HelloWorld.java