Article
· Nov 10, 2023 2m read

Using NativeAPI Command Line Extension from Java

In my previous articles, I described my Command Line Extension to NativeAPI.
Of course, this is also available for any other NativeAPI package.
So I created this example as a demo for the actual Java Contest.
<--break->
The package contains also an IRIS server in Docker for the demo
It is evident that it also works with any remote IRIS server.
You just have to provide it with my NativeAPI CommandLine Extension.

I think this demo is easy to follow and shows the essential features.

  • First, you install the package and start the container
  • then you start the demo
    docker-compose exec iris java rcc
  • Next, you connect  to your IRIS server defaults refer to the ádde IRIS server in the container
    >>> serverIP [127.0.0.1]:
    >>> serverPORT [1972]:
    >>> namespace [USER]:
    >>> username [_SYSTEM]:
    >>> password [SYS]:
    Connected to Instance IRIS on Server 1C09927CAE60 
  • Now, you get into the demo menu
    Select Demo to exercise 
     0 = free ObjectScript
     1 = $ZV from Server
     2 = Actual Time in Server
     3 = TimeZone Offset of Server
     4 = Server ArchitectureVendorModel
     5 = List Global in ZWRITE style
     * = Terminate demo
    
    And this is the result when you run through all 5 examples
  • 1
     IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2023.2 (Build 227U) Mon Jul 31 2023 18:04:28 EDT 
    
    2
     2023-08-15 07:42:16 
    
    3
     0 
    
    4
     x86_64 * Intel * Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz 
    
    0 
    >>> Your ObjectScript [ quit "?"]: quit $ZTS
     66701,27813.678790226 
    
    0 
    >>> Your ObjectScript [ quit "?"]: quit 17/4
     4.250000000000000000 
    
    0 
    >>> Your ObjectScript [ quit "?"]: quit 17/0
     <DIVIDE> 18 x^%ZX 
    
    5 
    >>> Your Global [^dc.MultiD]:
     ^dc.MultiD = 5
     ^dc.MultiD(1) = $lb("Braam,Ted Q.",51353)
     ^dc.MultiD(1,"mJSON") = "{}"
     ^dc.MultiD(2) = $lb("Klingman,Uma C.",62459)
     ^dc.MultiD(2,2,"Multi","a") = 1
     ^dc.MultiD(2,2,"Multi","rob",1) = "rcc"
     ^dc.MultiD(2,2,"Multi","rob",2) = 2222
     ^dc.MultiD(2,"Multi","a") = 1
     ^dc.MultiD(2,"Multi","rob",1) = "rcc"
     ^dc.MultiD(2,"Multi","rob",2) = 2222
     ^dc.MultiD(2,"mJSON") = "{""A"":""ahahah"",""Rob"":""VIP"",""Rob2"":1111,""Rob3"":true}"
     ^dc.MultiD(3) = $lb("Goldman,Kenny H.",45831)
     ^dc.MultiD(3,"mJSON") = "{}"
     ^dc.MultiD(4) = $lb("","")
     ^dc.MultiD(4,"mJSON") = "{""rcc"":122}"
     ^dc.MultiD(5) = $lb("","")
     ^dc.MultiD(5,"mJSON") = "{}"
     **** done ****
    
    Select Demo to exercise
     0 = free ObjectScript
     1 = $ZV from Server
     2 = Actual Time in Server
     3 = TimeZone Offset of Server
     4 = Server Architecture*Vendor*Model
     5 = List Global in ZWRITE style
     * = Terminate demo
    * >>> exit [OK]: Thank you for trying the demo

Video

GitHub

Discussion (2)1
Log in or sign up to continue

Hi Robert,

Your video is available on InterSystems Developers YouTube:

⏯️ Java client using IRIS NativeAPI CommandLine Extension

https://www.youtube.com/embed/vx3Zep7yDhQ?si=HEnmICq1u1yQdpjp
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]