I am trying to get a list of all of my query/400 queries using the Java library "JT400".
Here is the list represented visually in our terminal application:
I am an accountant by trade, not an AS400 programmer, so I don't know where or how these queries are stored or how the data is retrieved to create the above terminal interface.
I have worked a little with "ObjectList" querying, but don't know which library they would be in (if any). I came across some IBM tool online IBM Tool Doc, which is supposed to provide a command line interface for searching for query/400 objects, but I do not know if we have that installed or if it can do what I need.
Here is my code so far:
ObjectList queryList = new ObjectList(as400, ObjectList.CURRENT_LIBRARY, ObjectList.ALL, ObjectList.ALL);
try {
// Retrieve the list of queries:
queryList.load();
try {
System.out.println(queryList.getLength());
} catch (Exception e) {
e.printStackTrace();
}
Enumeration queries = queryList.getObjects();
for (Enumeration e = queries; e.hasMoreElements();{
System.out.println(e.nextElement());
}
} catch (Exception e){
System.out.println("There was an exception processing the list of queries:");
e.printStackTrace();
}
I finally got this to run without error, but the objects it returns don't look familiar to me and certainly are not the list of query names that I am used to seeing in the terminal.

I found the answer to my question.
You can generate a list of query/400 queries by user by using the ObjectList class in JT400.
The key is to use "*QRYDFN" in your constructor when defining the object type. In my code, I also specified the specific user in the first string parameter. See constructor info and my code below:
JT400 Docs "ObjectList":
Working code:
Resulting list: