View Full Version : Java library list
07-16-2002, 05:00 AM
I ran into this. The way I solved the problem is to use User Open on my files so when I go into the pgm this first thing done was to set the LIBL, then open the files and execute the trigger.
07-16-2002, 05:35 AM
I've not delt with Java (I assume JDBC) specifically, but I'd bet it should work the same as ODBC in that the server (iSeries) job should use the library list specified in the job description for the user profile you connect with. I know in our ODBC apps we are able to change the library list used by changing the user profile we connect with (Development, test, production). Does your connection's user have a library list specified in his job description?
07-17-2002, 06:36 AM
I don't think the user profile has a library list - I will need to check on this as I don't have authority to look at the user profile (overly-anal systems administration has security locked down extremely tight). I will check! Thanks for the response! Julie
07-17-2002, 08:52 AM
Technically speaking, the user profile has a job description, the job description has a library list. However, it's possible (likely?) that the user has QDFTJOBD as the job description. That jobd is unlikely to have the right libraries in it.
07-17-2002, 12:16 PM
The CommandCall class in the AS400 java tool kit permits a Java program to call a non-interactive command ... like ADDLIBLE. Here is an example program from Coulthard/Farr's book:
07-17-2002, 03:56 PM
Keep in mind, when using CommandCall to set the library list, that you are setting the list for the job associated with the AS400 connection object qualified with the construction of the CommandCall object. Any other Java processing using jt400 objects tied to that AS400 object's job will then use that library list. The problem comes in when you use JDBC. JDBC objects are all associated with a JDBC Connection object which has its own AS/400 job and, hence, its own library list. What you can do is create an SQL stored procedure that sets the library list and call that with a JDBC CallableStatement object.
07-18-2002, 06:50 AM
Again I'm coming from the MS side (OLEDB & ODBC not JDBC and Java) but I hate solutions that require me to do client side stuff to have my server setup correctly. Most typical ODBC (and I'd imagine JDBC) programmers are used to a process that says 1) Connect 2) Execute SQL 3) Disconnect to add step "1.5)setup library list" is just asking for problems down the road. I'd look heavily into getting the as/400 to set the correct library list on its own. Also, what library(ies) do you add? Development? Testing? QA? Production? How do you differentiate between the environments? If you can get the iSeries to use the user's library list than it's as simple as connecting as a development user, a test user, a QA user or a production user to get the correct server-side configuration.
07-18-2002, 07:08 AM
The job description for the JDBC user was set to QDFTJOBD. I have had that changed to a jobd with the proper library list. We will test this today - will keep you all posted on how it turns out. Thanks for all the ideas! Julie
07-18-2002, 09:22 AM
Has anyone dealt with this situation? We are new to Java interaction with the AS/400 and have run up against this problem: A network based Java application performs an update to an AS/400 file. An AS/400 trigger program fires when the the update occurs. The trigger program cannot find the necessary files to run because the library list is never set up. Is there any way to set a library list from a Java program running on a server? Any help is appreciated!! Julie
07-18-2002, 09:22 AM
Great news!! Setting a unique job description with the library list coded worked just fine! I will now set up individual 'JAVA' userids with the proper job descriptions for each environment, production, development, and user acceptance. Thanks for all your help! Julie
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.