JT400 Read File From IFS with user without password

落爺英雄遲暮 提交于 2019-12-12 02:27:27

问题


our problem is the following:

We have to connect to an ISeries with the JT400 and read a file in the IFS. One requirement is the job is running in the QBatch with a user without password. Our code is the following:

  //This wy we connect to the Iseries with the job credentials in this case 
   //user withou password
 AS400 as400 = new AS400(); 
 IFSFile file = new IFSFile(system, path);

  //This line throws the AS400SecurityException
 IFSFileInputStream fis = new IFSFileInputStream(file,IFSFileInputStream.SHARE_NONE);

The last line throws this exception: com.ibm.as400.access.AS400SecurityException: Password is not set

We searched on internet but couldn´t find anyone with same problem

Thank you for reading our question


回答1:


Try connecting to the host using

AS400 as400 = new AS400("localhost","*CURRENT","*CURRENT");

See http://javadoc.midrange.com/jtopen/com/ibm/as400/access/AS400.html#AS400(java.lang.String,%20java.lang.String,%20java.lang.String)



来源:https://stackoverflow.com/questions/33529107/jt400-read-file-from-ifs-with-user-without-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!