Midrange News for the IBM i Community

Posted by: renojim
CL, java and qtemp
has no ratings.
Published: 23 May 2019
Revised: 14 Aug 2019 - 227 days ago
Last viewed on: 26 Mar 2020 (233 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

CL, java and qtemp Published by: renojim on 23 May 2019 view comments(4)

I'm quite sure the answer is no, but there are much higher minds than mine here and I could be wrong. It's happened before. Is there a way to, from CL, create a table in qtemp, then access that table from a java program called via QSH?

Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Comment on: CL, java and qtemp
Posted: 10 months 5 days 19 hours 12 minutes ago
Edited: Wed, 29 May, 2019 at 18:34:14 (304 days ago)

Does QSH run in a thread or something? Why wouldn’t you be able to get to the file from JAVA?

Perhaps I’m not understanding the context of the environment you’re setting up.

Posted by: renojim
Premium member *
Comment on: CL, java and qtemp
Posted: 9 months 19 days 3 hours 57 minutes ago

Sorry for not responding. I've been off on another 'track'. This process works fine if I use some other library, but it does not work with QTEMP. Having a difficult time trying to figure out why, however, this process only needs to run one more time at the end of the year. After that it, like myself and my co-workers, are going to be replaced by packaged software and put out to pasture. So since it works with another library, I'll leave it that way because in this case at least, good enough is in fact good enough. Thanks much though.

Posted by: MarkSWaterbury
Comment on: CL, java and qtemp
Posted: 7 months 14 days 18 hours 23 minutes ago

I believe the problem is because STRQSH (aka. QSH) spawns a separate BCI job, just like QP2TERM does.   As a separate job, each spawned BCI job will have its own "QTEMP."



Posted by: MarkSWaterbury
Comment on: CL, java and qtemp
Posted: 7 months 14 days 18 hours 20 minutes ago

Also, if you do not use STRQSH or QSH but instead just run the Java stuff directly within the same job, e.g. via the RUNJVA or JAVA command, (in IBMi or OS/400), then it will "work" as the JVM will be in the same "job" and so it will share the same QTEMP.