Apologies if this is too unrelated to SQLcl.
I did my best to follow the instructions at these two links, and I have this working, 'sort of'.
Initially, I was able to get 'util' and 'sqlcl' functions / methods to work, but the code would fail with the below error when trying to do a 'myConnection.ctx.write("Any value in here \n");'
Exception in thread "main" java.lang.NullPointerException
While trolling through Google for anything that might help, I happened on a page that seemed somewhat unrelated that suggested putting these lines ahead of the attempt to myConnection.ctx.write():
myConnection.sqlcl.setStmt("set encoding UTF-8");
And this worked -- suddenly my 'myConnection.ctx.write()' calls are not generating an error and are appearing in the output...EXCEPT...
...if I execute an sqlcl call that returns rows, it appears no subsequent attempts to execute 'myConnection.ctx.write()' calls will put anything into the output. e.g., from the example:
myConnection.sqlcl.setStmt("select table_name from user_tables where rownum < 4; \n");
From those lines onward, no attempt to write output via the myConnection.ctx object will be visible.
I can't find anywhere if this is a known problem, and I also am not sure where (or if) this functionality in Netbeans is being maintained, since I don't experience this problem when I run the same code through SQLcl.
Appreciate any suggestions of who / where to ask.