MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » December 2012

Re: JTOpen jdbc driver question about calling stored procedures.



fixed

Why is is calling the external name? That is the name of the program on the
AS/400. He needs the name you assigned when you did the CREATE PROCEDURE on
the AS/400.


On Wed, Dec 12, 2012 at 2:43 PM, Michael Schutte <mschutte369@xxxxxxxxx>wrote:

I'm having a tough time with this. We have PC software that connects to
the System i (iSeries, as/400, etc, etc, etc) using the JTOpen jdbc
drivers. I have a developer in Texas that needs a SQL Stored Procedure
that will call a CL and return a value through the INOUT parm. For two
days, the vendors told him that the stored procedure external name must be
hardcoded. I said that cannot be true, I know that you can change the
naming to system and set the library list on the connection. They kept
telling him that it can't be done. So I found this website.


http://javadoc.midrange.com/jtopen/com/ibm/as400/access/doc-files/JDBCProperties.html

sure enough there are properties that can be set on the URL. So I had the
developer change is URL to look like this...

jdbc:as400://iseries_system;naming=system;libraries=ODWPROD, WDLSDATA, WDLS


The connection passed validation. However when he tries to call the
procedure where EXTERNAL NAME EBI001C, it fails giving a message of
"java.sql.SQLException:
Descriptor index not valid"


So I found this.


Does your program fail when it tries to *execute a stored procedure*
using
the Toolbox JDBC driver? Does your program receive
"java.sql.SQLException:
Descriptor index not valid"?

- Make sure the procedure exists on the IBM i.


- For the location of the procedure, make sure the schema name is
used, not the library name.


- Make sure the procedure being called does not expect input
parameters.

http://www-03.ibm.com/systems/i/software/toolbox/troubleshooting.html


It says for the location of the procedure, make sure the schema name is
used, not the library name. My question.. is it referring to the CALL
statement of the stored procedure or is referring to the EXTERNAL NAME on
the create procedure statement?

I really don't want the developer to have to hard code the library because
we will eventually move programs from it's current library to another. We
are going to separate the programs from the data files into two libraries.

Other information. The CL program is pulling a variable from a data area
that is not in ODWPROD, instead it's in the WDLS library.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact