Re: is there anyone who has some idea? i am trying to call Stored procedure using JDBC

From: Jan M. Nelken (Unknown.User_at_Invalid.Domain)
Date: 02/19/05

  • Next message: Lee Fesperman: "Re: is there anyone who has some idea? i am trying to call Stored procedure using JDBC"
    Date: Fri, 18 Feb 2005 19:15:51 -0500
    
    

    Kelly wrote:

    > I am trying to use jdbc to call sp procedure in UDB 8.1, the following
    > is the jdbc code.
    > ------------------------------------------------------------------------------------------
    > con = getConnection();
    > cstmt = con.prepareCall("call db2admin.cj_sp_auth(?,?,?,?,?)");
    > cstmt.setString(1, userName);
    > cstmt.registerOutParameter(2, Types.VARCHAR);
    > cstmt.registerOutParameter(3, Types.INTEGER);
    > cstmt.registerOutParameter(4, Types.CHAR);
    > cstmt.registerOutParameter(5, Types.INTEGER);
    >
    > // Execute the stored procedure call.
    > cstmt.execute();
    > ------------------------------------------------------------------------------------------

    1. You posted this question twice. Once would do better.

    2. Your Stored Procedure has a little problem: it works when Username is found,
    however it does not work very well when Username does not exist for example.

    You may want to test it from command line first; for example:

    D:\Temp>db2 call cj_sp_auth('WrongName',?,?,?,?)

       Value of output parameters
       --------------------------
       Parameter Name : O_PASSWORD
       Parameter Value :

       Parameter Name : GRDBSTA
       Parameter Value : 1

       Parameter Name : V_MESSAGE
       Parameter Value :

       Parameter Name : GRDBDES
       Parameter Value : 2000

       Return Status = 0

    3. Your jdbc code is incomplete:

    where are definitions and setXXXXX calls for your output parameters?

    4. You may have better luck when asking in IBM DB2 newsgroup
    (comp.databases.ibm-db2).

    Jan M. Nelken


  • Next message: Lee Fesperman: "Re: is there anyone who has some idea? i am trying to call Stored procedure using JDBC"

    Relevant Pages

    • Re: Problem with IIS and server extensions.
      ... I'm having problems with managing server extensions. ... Then iexplore pops up, and with a box for username and password. ... I have tried my administrator and password, no luck.. ...
      (microsoft.public.frontpage.extensions.windowsnt)
    • XP Start Programs
      ... have to navigate to your USERNAME, Programs, etc. ... Good Luck! ... >uninstall them later on. ... which impedes any new programs from being ...
      (microsoft.public.windowsxp.general)
    • outlook 2007 password problem
      ... It seems that everytime a ... message is composed the software asks for the username and password even ... online fixes such as renaming the protected storage directory with no luck. ... Systems technician ...
      (microsoft.public.office.misc)
    • Re: IIS6 SBS 2003 and Multiple FTP sites
      ... Err Msg: 530 User <Username> Cannot Log In, ... if no luck, ... I as reviewing the KB page you referred too. ...
      (microsoft.public.inetserver.iis.ftp)
    • Re: Limit Query to Current User Name
      ... doing this from outside of Access, you're out of luck, as you cannot use VBA ... the current username is the query conditions without the user having to ...
      (microsoft.public.access.queries)