Results 1 to 5 of 5
  1. #1
    dayneo is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Question Object reference to number

    Hi all,

    I am new to Java and need some assistance. I am using java stored procedures in Oracle and need to convert an object reference in java to a number so that I can pass it back to Oracle for use further down the oracle stored procedure. See the following code for a rough idea of what I am trying to accomplish:

    Java Code:
    // Java
    class jsp
    {
    static int GetObject()
    {
      Object o = new Object();
      int ref = GetRef(o);
      return ref;
    }
    
    static void SetValue(int ref, string value)
    {
      Object o = GetObject(ref);
      o.setProperty = value;
    }
    }
    Java Code:
    -- Oracle stored proc
    create or replace procedure do_something as
    
      l_ohnd  number;
    
    begin
    
      l_ohnd := jsp.GetObject();
      
      -- oracle code...
    
      jsp.SetValue(l_ohnd, 'new value');
    
    end do_something;
    I am struggling with the "GetRef" part.... :confused: I don't know how to accomplish it in Java. Any help or links would be appreciated...

  2. #2
    M77's Avatar
    M77
    M77 is offline Member
    Join Date
    May 2008
    Location
    LV
    Posts
    43
    Rep Power
    0

    Default

    Try to read some Java manual for beginners.

  3. #3
    dayneo is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default

    RTFM?
    Which FM? I think for a java beginner, I am doing something a little more advanced. Google searches havn't given me anything even close yet... :(

  4. #4
    M77's Avatar
    M77
    M77 is offline Member
    Join Date
    May 2008
    Location
    LV
    Posts
    43
    Rep Power
    0

    Default

    Strange command "o.setProperty = value;"
    No property name.

  5. #5
    dayneo is offline Member
    Join Date
    May 2008
    Posts
    3
    Rep Power
    0

    Default

    The point is not the syntax... I was really just writing pseudo code...
    sure
    o.setProperty(value);

    But what I want is to get the handle to o as a number. Then be able to convert the number back to the java object instance o.

Similar Threads

  1. Object and reference
    By katie in forum New To Java
    Replies: 2
    Last Post: 10-19-2009, 03:45 PM
  2. Replies: 1
    Last Post: 04-15-2008, 12:09 PM
  3. Replies: 0
    Last Post: 04-15-2008, 08:12 AM
  4. Getting the Object Reference Name
    By Deathmonger in forum New To Java
    Replies: 2
    Last Post: 03-12-2008, 02:51 PM
  5. reference to elements in array
    By Igor in forum New To Java
    Replies: 1
    Last Post: 12-14-2007, 11:56 AM

Posting Permissions

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