"java.sql.SQLException: Descriptor index not valid."
If you are running an SQL query (in this case with Java) against an AS/400 and get the above message, try replacing the code in your resultset loop. Find the line that looks like this:
rs.getString(0)And replace with lines like this:
Notice, the records is being retrieved by name instead of by index. Alternately, you can try:
The underlying problem is resultset indexes start at  instead of . This is confusing as most Java indexes start counting at 0. Hope this helps. What the message should probably say is "resultset index is out of bounds for the returned set". But jt400 is a free driver, so we can live with that message. :)
Also note, that if you do "SELECT PFNMCN AS FIRSTNAME...", then your code should read:
This java error message can be confusing at first, but it is a very quick fix!
Edit: If you use an exit point program for security purposes, make sure to capitalize your "SELECT" statements!!!!