Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2006
    Posts
    3

    Unanswered: [DB2] Calling SYSPROC.DB2LOAD

    Hi,

    I'm trying to call the load utility via JDBC.

    CallableStatement cstmt = con.prepareCall("CALL SYSPROC.DB2LOAD(?)");
    cstmt.setString(1,"LOAD FROM ...");
    return cstmt.execute();

    But everytime I try I get:

    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0444N Routine "SYSPROC.DB2LOAD" (specific name "SQL060127113434890") is implemented with code in library or path "\SYSPROC.DB2LOAD", function "SYSPROC.DB2LOAD" which cannot be accessed. Reason code: "4". SQLSTATE=42724

    I looked at the routings table of the database and the internal description for DB2LOAD is COM.ibm.db2.jdbc.app.DB2Blob@4e440830.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Try running SYSPROC.SYSINSTALLROUTINES. By the way, are you sure you got the signature of DB2LOAD right?

    And what has it to do with Java?

  3. #3
    Join Date
    Jan 2006
    Posts
    3
    Quote Originally Posted by n_i
    Try running SYSPROC.SYSINSTALLROUTINES.
    you mean "CALL SYSPROC.SYSINSTALLROUTINES"? I tried it (return code was 0) but nothing changed

    Quote Originally Posted by n_i
    By the way, are you sure you got the signature of DB2LOAD right?
    cstmt.setString(1,"1,'','load from /fully/qualified/path/staff.del of del replace into staff2',?,'',?,?,?,?,?,?,?,?,?,NULL");
    An official example from IBM und works fine in CLP (see below).

    Quote Originally Posted by n_i
    And what has it to do with Java?
    Because if I'm using the CLP the CALL DB2LOAD(...) works fine but when I try to call it with JDBC it fails. And since JDBS IS Java I thought it is a Java problem. Maybe I'm wrong

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by Slurms
    cstmt.setString(1,"1,'','load from /fully/qualified/path/staff.del of del replace into staff2',?,'',?,?,?,?,?,?,?,?,?,NULL");
    An official example from IBM und works fine in CLP (see below).
    So, you didn't get it right.

    Code:
    CallableStatement cstmt = con.prepareCall("CALL SYSPROC.DB2LOAD(?, ?, ?, ?, ?..)");
    cstmt.setInt(1,1);
    cstmt.setString(2,"LOAD FROM ...");
    cstmt.setString(3,"");
    cstmt.registerOutParameter(4,java.sql.Types.INTEGER);
    ...

  5. #5
    Join Date
    Jan 2006
    Posts
    3
    Quote Originally Posted by n_i
    So, you didn't get it right.

    Code:
    CallableStatement cstmt = con.prepareCall("CALL SYSPROC.DB2LOAD(?, ?, ?, ?, ?..)");
    cstmt.setInt(1,1);
    cstmt.setString(2,"LOAD FROM ...");
    cstmt.setString(3,"");
    cstmt.registerOutParameter(4,java.sql.Types.INTEGER);
    ...
    ok,thanks. I'll try it tomorrow...

Posting Permissions

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