Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    4

    Unanswered: Stored Proc runs in SP Builder, but not in Servlet

    The following stored procedure runs fine from the SPB, but I get the following exception when trying to run it from the code. Ive got about 50 procedures where about 75% run with the same code, whereas Im experiencing this problem with the other 25%. Any help in the right direction would be awesome. Thanks.

    The exception:

    java.lang.Exception: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/LINUX] SQL10013N The specified library "/home/db2inst1/sqllib/function/SP_DCS_GETUSERFULLNAME" could not be loaded.

    relevant code:
    public ResultSet getUserFullName(int iUserPositionId) throws Exception {
    String strSQL = "CALL SP_DCS_GETUSERFULLNAME " + iUserPositionId;
    return getResultSet(strSQL);
    }
    public ResultSet getResultSet(String strSQL) throws Exception {
    try { rsResult = stmt.executeQuery(strSQL);
    return rsResult;
    } catch (Exception e) { throw new Exception(e.toString()); } }

  2. #2
    Join Date
    Oct 2001
    Location
    Bangalore
    Posts
    186
    Hi,

    Can you check if you have given specific names to all the procedures or atleast 25% which are failing. I am not sure but it may be one of the reasons. Also check if you have the procedures properly compiled.
    Ask your DBA to call the procedures from backend first for trial.

    cheers,
    Prashant

  3. #3
    Join Date
    Feb 2004
    Posts
    9

    Re: Stored Proc runs in SP Builder, but not in Servlet

    What type of object is stmt? It needs the be a CallableStatement otherwise it will not work.

    // Create the callable statement
    CallableStatement cs = connDB2.prepareCall("{CALL SP_DCS_GETUSERFULLNAME (?)}");

    // Bind your parameters
    cs.setInt(1, iUserPositionId);

    // Execute the qeury
    cs.executeQuery();

    // Get the result set

    ResultSet rs = cs.getResultSet();

    .. that works.

    Tim
    Originally posted by Kevin Ferron
    The following stored procedure runs fine from the SPB, but I get the following exception when trying to run it from the code. Ive got about 50 procedures where about 75% run with the same code, whereas Im experiencing this problem with the other 25%. Any help in the right direction would be awesome. Thanks.

    The exception:

    java.lang.Exception: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/LINUX] SQL10013N The specified library "/home/db2inst1/sqllib/function/SP_DCS_GETUSERFULLNAME" could not be loaded.

    relevant code:
    public ResultSet getUserFullName(int iUserPositionId) throws Exception {
    String strSQL = "CALL SP_DCS_GETUSERFULLNAME " + iUserPositionId;
    return getResultSet(strSQL);
    }
    public ResultSet getResultSet(String strSQL) throws Exception {
    try { rsResult = stmt.executeQuery(strSQL);
    return rsResult;
    } catch (Exception e) { throw new Exception(e.toString()); } }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •