Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jan 2003
    Posts
    13

    Question Unanswered: DB2 8.1 - Stored Procedures

    I'm using Db2 8.1 for Linux and try to write a Java stored procedure using the DB2 Development Center.

    The build fails (during the "Call sqlj.install_jar")
    and next message is generated:
    SQL1042C An unexpected system error occurred.

    Any ideas ?
    What to check, what to configure ?
    Thanks in advance.
    Last edited by exp; 01-14-03 at 06:23.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: DB2 8.1 - Stored Procedures

    Your db2diag.log might have some pointer ...

    Cheers

    Sathyaram

    Originally posted by exp
    I'm using Db2 8.1 for Linux and try to write a Java stored procedure using the DB2 Development Center.

    The build fails (during the "Call sqlj.install_jar")
    and next message is generated:
    SQL1042C An unexpected system error occurred.

    Any ideas ?
    What to check, what to configure ?
    Thanks in advance.

  3. #3
    Join Date
    Jan 2003
    Posts
    13

    Question

    Thanks.
    The db2diag.log describes the problem much better.

    However I seem unable to fix it.
    The message is:
    error loading module: libdb2jext.so
    errno = 9

    I've located the missing libray and updated the environment:
    AddtoString LD_LIBRARY_PATH ${DB2DIR}/lib
    AddtoString LD_LIBRARY_PATH ${JAVA_HOME}/jre/bin

    but it doens't seem to help. The message remains unchanged.

    Suggestions ?
    Last edited by exp; 01-14-03 at 06:30.

  4. #4
    Join Date
    Feb 2002
    Posts
    12
    Try symbolic link to /usr/lib dir.

    cd /usr/lib
    ln -fs $UDB_HOME/lib/...so .

    Rey

  5. #5
    Join Date
    Jan 2003
    Posts
    13
    Thanks, you were right.
    Had to add 4 links under /usr/lib
    in order to stop the 'lib*.so' related errors.

    However the Developer Center still doesn't work.
    The new message is:
    [IBM][CLI Driver][DB2/LINUX] SQL1131N DARI (Stored Procedure) process has been terminated abnormally. SQLSTATE=38503

    And in the db2diag.log the message reads:
    "A non-EDU child crashed."


    Anybody got a clue what to configure ?

  6. #6
    Join Date
    Feb 2002
    Posts
    12
    Whick Java SDK you have? And which Linux version Redhat or others?
    I have a Java external UDF problem, still waiting for a solution?

    Rey

  7. #7
    Join Date
    Jan 2003
    Posts
    13
    I'm using RedHat Linux 8.0
    with sdk that was part of the DB2 installation
    (IBM Java2 - 1.3.1)

  8. #8
    Join Date
    Feb 2002
    Posts
    12
    Have you tried sqllib/samples/java programs?
    Try compile and test those java programs first.

  9. #9
    Join Date
    Jan 2003
    Posts
    13
    I've been trying to build stored procedures
    created with the DB2 wizard without any addition of code on my behalf. They are supposed to be built in any case.

    Yet they don't.
    The jar is created, the build fails (DB2 simply refuses to load the generated jar into the database).

    The wizard auto-generated stored procedure looks as
    following (sql is valid - checked in the Command Center):

    /**
    * JDBC Stored Procedure PROC1
    */
    import java.sql.*; // JDBC classes

    public class PROC1
    {
    public static void pROC1 ( ResultSet[] rs1 ) throws SQLException, Exception
    {
    // Get connection to the database
    Connection con = DriverManager.getConnection("jdbc:default:connecti on");
    PreparedStatement stmt = null;
    boolean bFlag;
    String sql;

    sql = "SELECT PROCEDURES.PROCSCHEMA, PROCEDURES.PROCNAME"
    + " "
    + " FROM SYSCAT.PROCEDURES AS PROCEDURES";
    stmt = con.prepareStatement( sql );
    bFlag = stmt.execute();
    rs1[0] = stmt.getResultSet();
    }
    }

    Generated error:
    [IBM][CLI Driver][DB2/LINUX] SQL1131N DARI (Stored Procedure) process has been terminated abnormally. SQLSTATE=38503
    "A non-EDU child crashed."

    Anybody got an idea how to configure the DARI in order to
    fix the error ?
    Thanks.

  10. #10
    Join Date
    Feb 2002
    Posts
    12
    Could be the classpath is wrong for db2inst1?
    What is setting of your jdk11_path?
    db2 get dbm cfg | grep -i java

  11. #11
    Join Date
    Jan 2003
    Posts
    13
    The result of running "db2 get dbm cfg | grep -i java":
    Java Development Kit installation path (JDK_PATH) = /opt/IBMJava2-131
    Java Virtual Machine heap size (4KB) (JAVA_HEAP_SZ) = 2048

    The result of running "env | grep -i CLASSPATH":
    CLASSPATH=/home/db2inst1/sqllib/java/db2java.zip:
    /home/db2inst1/sqllib/java/db2jcc.jar:
    /home/db2inst1/sqllib/java/sqlj.zip:
    /home/db2inst1/sqllib/function:.

    Comment:
    "/home/db2inst1/sqllib/java" and "/home/db2inst1/sqllib/java12"
    are links to "/opt/IBM/db2/V8.1/java" (location of JDBC 2.0 drivers)

    Seems ok, please correct me if I'm wrong.

  12. #12
    Join Date
    Jan 2003
    Posts
    13
    Tried to run the standard samples.
    1) make SpServer
    is done ok
    2) make SpClient
    Is done and displays a list of presumably cataloged stored procedures.
    3) java SpClient
    failes and displays the same old (SQL1131N DARI ...) message for every stored procedure.

    Did anyone succeed in writing stored procedures
    for DB2 8.1 on RedHat 8.0 (or other) Linux ?
    If so, I'd appreciate configuration tips
    or a redirection to the relevant documentation.

    Thanks in advance.

  13. #13
    Join Date
    Jun 2003
    Posts
    2
    hi exp,

    I encountered exactly same as your problem. Do you have
    any workaround solutions now?

    Best regards.

  14. #14
    Join Date
    Jun 2003
    Posts
    2
    hi exp,

    I encountered exactly same as your problem. Do you have
    any workaround solutions now?

    Best regards.

  15. #15
    Join Date
    Sep 2003
    Posts
    4
    Just turn off autostart db2instance during boot up of your linux
    and start the db2instance manually in command shell.

    Then it could solve your problem.

    Just a workaround solution, not yet confirmed whether this is
    a bug or not by IBM support.

Posting Permissions

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