diff --git a/Samples-java-helloworld.iml b/Samples-java-helloworld.iml new file mode 100644 index 0000000..d0aaab2 --- /dev/null +++ b/Samples-java-helloworld.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples-java-helloworld.ipr b/Samples-java-helloworld.ipr new file mode 100644 index 0000000..3e55a2f --- /dev/null +++ b/Samples-java-helloworld.ipr @@ -0,0 +1,350 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..132fe14 --- /dev/null +++ b/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + com.intersystems.samples + iris-helloworld + 1.0-SNAPSHOT + + jar + InterSystems IRIS Sample + InterSystems IRIS Tutorial Code Sample. + http://intersystems.com + 2019 + + + + com.intersystems + intersystems-jdbc + 3.0.0 + + + + + + + maven-assembly-plugin + + + package + + single + + + + + true + ${project.build.directory}/dependency/ + + src/main/resources/META-INF/MANIFEST.MF + + ${maven.build.timestamp} + ${project.description} + ${project.artifactId} + ${project.name} + ${project.organization.name} + ${project.url} + ${project.name} + ${project.organization.name} + ${project.groupId} + ${project.version} + true + + + + jar-with-dependencies + + + + + + + + + + \ No newline at end of file diff --git a/src/demo/HelloWorld.java b/src/demo/HelloWorld.java deleted file mode 100644 index f7f580c..0000000 --- a/src/demo/HelloWorld.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -* PURPOSE: Makes a connection to an instance of InterSystems IRIS Data Platform. -*/ -package demo; - -import java.sql.Connection; -import java.sql.SQLException; - -import com.intersystems.jdbc.IRISDataSource; - -public class HelloWorld { - - public static void main(String[] args) { - String ip = "localhost"; - int port = 51773; - String namespace = "USER"; - String username = "SuperUser"; - String password = "SYS"; - try { - // Using IRISDataSource to connect - IRISDataSource ds = new IRISDataSource(); - - // Create connection string - String dbUrl = "jdbc:IRIS://" + ip + ":" + port + "/" + namespace; - ds.setURL(dbUrl); - ds.setUser(username); - ds.setPassword(password); - - // Making connection - Connection dbconnection = ds.getConnection(); - System.out.println("Hello World! You have successfully connected to InterSystems IRIS via JDBC."); - dbconnection.close(); - - } - catch ( SQLException e) - { - System.out.println(e.getMessage()); - } - } - -} - - diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000..58b3ae5 --- /dev/null +++ b/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Main-Class: com.intersystems.samples.HelloWorld