Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322

    Unanswered: Java syntax to Call a sproc in DB2 OS/390

    Any Java developers out there that have called a sproc on the mainframe?

    Any comments welcome.

    Thanks
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  2. #2
    Join Date
    Feb 2004
    Posts
    9

    Re: Java syntax to Call a sproc in DB2 OS/390

    Brett,

    Here are the basics.

    // Load JDBC driver
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").ne wInstance() ;
    // Get database connection
    Connection connDB2 = DriverManager.getConnection
    ("jdbc:db2:database","username", "pwd");


    //
    CallableStatement cs = connDB2.prepareCall("{CALL schema.spname(?,?,?,?,?)}");

    // Register your out parameters
    cs.registerOutParameter(1, Types.INTEGER);
    cs.registerOutParameter(2, Types.CHAR,70);
    cs.registerOutParameter(3, Types.CHAR,5);
    cs.registerOutParameter(4, Types.CHAR,50);

    // set your in parameters
    cs.setLong(5, Long.parseLong(iIdx));
    // execute it.
    cs.execute();

    Originally posted by Brett Kaiser
    Any Java developers out there that have called a sproc on the mainframe?

    Any comments welcome.

    Thanks

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Hey,

    Thanks a bunch...

    Another question

    Anyone doing INTERNAL stored procedures on OS/390...

    Looked around in my shop (through the catalogs) and NOBODY is using INTERNAL

    They're all external


    Also, what's the point of external?

    Still gotta write a COBOL (or whatever) program anyway...

    AND I noticed that only INTERAL sprocs are stored in the database in sysroutines_src..
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    All Non SQL Stored Procs are EXTERNAL ...

    Have a look at the CREATE PROCEDURE Statement which says LANGUAGE SQL

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Originally posted by sathyaram_s
    All Non SQL Stored Procs are EXTERNAL ...

    Have a look at the CREATE PROCEDURE Statement which says LANGUAGE SQL

    HTH

    Sathyaram
    Yeas, I know...I go tthat far...I've create the INTERnAL Sproc...

    The devloper is just trying to call it...

    Does anyone use INTERNAL Sprocs though?

    They seem quite painful....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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