Results 1 to 3 of 3
  1. #1
    Aispam is offline Member
    Join Date
    Dec 2013
    Posts
    2
    Rep Power
    0

    Default PL/SQL procedure to Java stored procedure

    Hello,

    I got a school assignement "Create a java stored procedure and call it out from JAVA program outside database".
    I've done it, but in case of JAVA stored procedure I have the procedure written in PL/SQL.

    PL/SQL procedure:

    Java Code:
    CREATE OR REPLACE PROCEDURE getDogInfo
    (Dog_ID IN NUMBER, Dog_name OUT VARCHAR) AS
    BEGIN
      SELECT Name INTO Dog_name
      FROM Dog_family
      WHERE ID = Dog_ID;
    END;
    How do I convert it to JAVA stored procedure?
    Maybe it's just plain stupid and I should keep it as PL/SQL? I don't know if I have done it right.
    Also I don't know what to do with IN/OUT parameters in JAVA.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,743
    Rep Power
    5

    Default Re: PL/SQL procedure to Java stored procedure

    > I should keep it as PL/SQL
    You should do what you are instructed to do

    > How do I convert it to JAVA stored procedure?

    1) you learn how to do it. This involves actual study
    2) you apply the knowledge you learned
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,846
    Rep Power
    19

    Default Re: PL/SQL procedure to Java stored procedure

    There's little point converting that to a Java stored procedure if you don't have to.
    It's not what Java SP's were intended for.

    Just call that from your Java application via JDBC.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 1
    Last Post: 06-19-2012, 09:39 AM
  2. java call stored procedure
    By namalsera in forum JDBC
    Replies: 1
    Last Post: 01-04-2011, 03:53 PM
  3. Replies: 1
    Last Post: 09-10-2010, 03:47 PM
  4. How to call Oracle stored procedure from Java?
    By parag_narkhede in forum New To Java
    Replies: 4
    Last Post: 10-07-2009, 07:50 AM
  5. Replies: 2
    Last Post: 01-30-2009, 12:53 PM

Tags for this Thread

Posting Permissions

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