Question Suman Samanta · Mar 22, 2022

load and compile from java

Hi i am trying to load and compile one class from java . I am following this code. I am using iris 2021.2

             irisConnection = (IRISConnection) DriverManager
                     .getConnection("jdbc:IRIS://10.20.30.40:51773/MYNAMESPACE", "username", "password");
             iris = IRIS.createIRIS(irisConnection);
             iris.classMethodStatusCode("%SYSTEM.OBJ", "Load", "/filePath/SumanPramodTest.test3.CLS.xml","/displaylog=0 /displayerror=0");

When i am passing cuk  or ck in qspec param , i am getting error . but when i pass "/displaylog=0 /displayerror=0" it does not throw an error but does not compile the class too. 

Any leads would be of great help  .

Comments

Dan Pasco · Mar 24, 2022

You can try using "ck-d" for the flags/qualifiers.

0
Suman Samanta  Apr 13, 2022 to Dan Pasco

I used "cuk/display=none" as flag and that solved the issue.

0
Dan Pasco · Mar 24, 2022

There is a project that will be available soon (don't ask me to define "soon") that will allow the Java programmer to load and compile sources from the local system into an IRIS Server. The IRIS Server does not need to be running on the same system where the files are located.

This example is slightly old as the current implementation of load() returns a list of items loaded and compile() returns a list of items compiled. There are load implementations that accept directories, individual files, any Java streamable, and also JAR files.

SourceLoader sourceLoader = new SourceLoader(connection);
Path path = Paths.get("path/to/samples/cls/Sample");
sourceLoader.load(path, null);
sourceLoader.compile(true);
0
Dan Pasco  Mar 24, 2022 to Dan Pasco

This project will be available as intersystems-utils, version 4.0.0. It is in the pipeline now.

0