title: DB2 iSeries - not able to access table from stored proc
body: <p>I am accessing DB2 iSeries version 6.3 using JDBC driver. The call to a stored procedure fails with the following error:</p>
  <pre><code>[SQL0204] GENHST in TSTUSR type *FILE not found.
  </code></pre>
  <p>The connection string is:</p>
  <pre><code>jdbc:as400://db2.abc.com/DBName;naming=system;libraries=*LIBL;block size=512;lob threshold=0;package library=QGPL;prompt=false;translate binary=true;remarks=system;cursor hold=false;
  </code></pre>
  <p>When I connect using Squirrel client with the same user and same connection string as I used for JDBC connection, I am able to view data in GENHST table. The stored proc is referring to GENHST table without specifying a schema name.</p>
  <p>Please help with any ideas. What could be going wrong?</p>
  <h2>EDIT:</h2>
  <p>The issue is fixed if I remove the database name from the connection string and add the schema that contains the stored proc to the connection string.</p>
  <pre><code>jdbc:as400://db2.abc.com/;naming=system;libraries=*LIBL,PROC_SHEMA;block size=512;lob threshold=0;package library=QGPL;prompt=false;translate binary=true;remarks=system;cursor hold=false;
  </code></pre>
  <p>I do not really understand what is going on.</p>