How to use the programe of java in oracle

Hello Expert,

My Config is: -.

Forms [32 bit] Version 11.1.1.3.0 (Production)

JDeveloper - 10.1.3

I want to use the java programe in the form builder. I create a java class in Jdeveloper.

package demo;

import java.net.InetAddress;

import java.net.NetworkInterface;

java.net.SocketException import;

java.net.UnknownHostException import;

public class get_info {}

Public Shared Sub main (String [] args) {}

ch_add();

}

public static ch_add() Sub

{

InetAddress ip;

try {}

IP = InetAddress.getLocalHost ();

/*System.out.println ("current IP address:" + ip.getHostAddress ());  */

NetworkInterface network = NetworkInterface.getByInetAddress (ip);

Mac Byte [] = network.getHardwareAddress ();

/*System.out.print ("MAC address current :");   */

StringBuilder sb = new StringBuilder();

for (int i = 0; i < mac.length; i ++)

{

SB. Append (String.format ("% 02 X %s", mac [i], (I < mac.length - 1)?)) "-" : ""));

}

System.out.println (SB. ToString());

} catch (UnknownHostException e) {}

e.printStackTrace ();

} catch (SocketException e) {}

e.printStackTrace ();

}

}

}

and Formweb.cfg and default.env and also add in Form_class_path. After that, I import this java in forms.

Code genertated-

PACKAGE get_info BODY IS

--

-DO NOT EDIT THIS FILE - it is machine generated!

--

args NYI. ARGLIST;

Constructor for signature (V)

New FUNCTION RETURN ORA_JAVA. JOBJECT IS

BEGIN

args: = NULL;

RETURN (JNI. NEW_OBJECT ("demo/get_info", "(V)", args));

END;

-Method: main ([Ljava/lang/String ;) V

Main PROCEEDINGS)

A0 ORA_JAVA. JACOB) IS

BEGIN

args: = NYI. CREATE_ARG_LIST (1);

NYI. ADD_OBJECT_ARG (args, a0, ' [Ljava/lang/String ;');)

NYI. CALL_VOID_METHOD (TRUE, NULL, "demo/get_info', 'hand', ' ([Ljava/lang/String ;)) V ", args);

END;

-Method: ch_add (V)

PROCEDURE ch_add IS

BEGIN

args: = NULL;

NYI. CALL_VOID_METHOD (TRUE, NULL, "demo/get_info", "ch_add", "(V)", args);

END;

-Method: wait (J) V

PROCEDURE to wait)

obj ORA_JAVA. JOBJECT,

NUMBER of a0) IS

BEGIN

args: = NYI. CREATE_ARG_LIST (1);

NYI. ADD_LONG_ARG (args, a0);

NYI. CALL_VOID_METHOD (FALSE, obj, "demo/get_info", "expect", "(J) V", args);

END;

-Method: wait (V)

PROCEDURE to wait)

obj ORA_JAVA. JOBJECT) IS

BEGIN

args: = NULL;

NYI. CALL_VOID_METHOD (FALSE, obj, "demo/get_info", "expect", "(V)", args);

END;

-Method: wait (JI) V

PROCEDURE to wait)

obj ORA_JAVA. JOBJECT,

NUMBER of a0,

The a1 NUMBER) IS

BEGIN

args: = NYI. CREATE_ARG_LIST (2);

NYI. ADD_LONG_ARG (args, a0);

NYI. ADD_INT_ARG (args, a1);

NYI. CALL_VOID_METHOD (FALSE, obj, "demo/get_info", "expect", "V (JI)", args);

END;

-Method: equals (Ljava/lang/object ;) Z

FUNCTION is equal to)

obj ORA_JAVA. JOBJECT,

A0 ORA_JAVA. JOBJECT) RETURN BOOLEAN IS

BEGIN

args: = NYI. CREATE_ARG_LIST (1);

NYI. ADD_OBJECT_ARG (args, a0, ' object java/lang / "");

BACK TO JNI. CALL_BOOLEAN_METHOD (FALSE, obj, "demo/get_info", "equal to", "(Ljava/lang/object ;)) Z', args);

END;

-Method: toString () Ljava/lang/String;

FUNCTION toString)

obj ORA_JAVA. JOBJECT) RETURN VARCHAR2 IS

BEGIN

args: = NULL;

BACK TO JNI. CALL_STRING_METHOD (obj, "demo/get_info", "toString", "() Ljava/lang/String"; FALSE, args);

END;

-Method: hashCode () I have

FUNCTION (hashCode

obj ORA_JAVA. JOBJECT RETURN NUMBER) IS

BEGIN

args: = NULL;

BACK TO JNI. CALL_INT_METHOD (FALSE, obj, "demo/get_info", "hashCode", ' () I ", args");

END;

-Method: getClass () Ljava/lang/class;

FUNCTION getClass)

obj ORA_JAVA. ORA_JAVA RETURN JOBJECT). JOBJECT IS

BEGIN

args: = NULL;

BACK TO JNI. CALL_OBJECT_METHOD (obj, "demo/get_info", "getClass", "() Ljava/lang/class"; FALSE, args);

END;

-Method: notify (V)

Notification PROCEDURE)

obj ORA_JAVA. JOBJECT) IS

BEGIN

args: = NULL;

NYI. CALL_VOID_METHOD (FALSE, obj, "demo/get_info', 'prevent',"(V)", args);

END;

-Method: notifyAll () V

PROCEDURE notifyAll)

obj ORA_JAVA. JOBJECT) IS

BEGIN

args: = NULL;

NYI. CALL_VOID_METHOD (FALSE, obj, "demo/get_info", "notifyAll", "(V)", args);

END;

BEGIN

NULL;

END;

Now, I want to call the o/p of the Java programe in the oracle text element. Please help me. It is very urgent. I'm not good in Java.

It is all explained in http://fdtool.free.fr/forms-pjc-bean/first-bean/first_bean.pdf

In essence, you need:

-a Java class that extends from oracle.forms.ui.VBean where you must implement getProperty, as stated in article method

-a unique property of your choice name

-forms of type point area of bean that should be visible and on a canvas

-you could then call your method using get_custom_property (, 1, )

Just adapt the example comes from the tutorial above. You can of course also use the FBean package so you will not need to extend kifani but simply to any class that extends from container. As a first step, maybe you must redo the complete tutorial to get a handle on the how and the why.

see you soon

Tags: Oracle Development

Similar Questions

  • How to use the nocopy with java stored procedures parameters

    
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    

    I'm a PL/SQL programmer, but not a Java programmer. I have the following java function that does what it's supposed to add a pdf at the end of another pdf document:

    import oracle.sql.BLOB;
    import org.apache.pdfbox.util.PDFMergerUtility;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    import java.io.OutputStream;
    
    public class PDFUtilities {
    public static BLOB appendPDF(BLOB pdfdoc1, BLOB pdfdoc2) throws Exception {
           
            //create a connection object to the current instance
              OracleConnection conn = (OracleConnection)new OracleDriver().defaultConnection();
            //create the output blob using the connection
              BLOB outPDF = BLOB.createTemporary(conn, true ,BLOB.DURATION_SESSION);
            //create an output stream to the output blob
              OutputStream os = outPDF.setBinaryStream(0);               
            //instantiate the pdf merger utility
              PDFMergerUtility mergerUtility = new PDFMergerUtility();       
            //connect the merger to the output stream
              mergerUtility.setDestinationStream(os);
            //stream from each input blob into the merger utility
              mergerUtility.addSource(pdfdoc1.getBinaryStream());
              mergerUtility.addSource(pdfdoc2.getBinaryStream());
            //merge the 2 input pdfs
              mergerUtility.mergeDocuments();             
            //do not close the output stream
            //return the blob
            return outPDF;
        }
    
    }
    

    CREATE OR REPLACE package PDFTOOLS.pkg_pdf_utilities
    as
    function f_get_merged_pdf (
              pi_pdf1       blob
            , pi_pdf2    blob
      )
      return blob;
    end pkg_pdf_utilities;
    /
    
    CREATE OR REPLACE package body PDFTOOLS.pkg_pdf_utilities
    as
    function f_get_merged_pdf (
              pi_pdf1       blob
            , pi_pdf2    blob
      )
      return blob
      as language java name 
      'com.mycode.pdftools.PDFUtilities.appendPDF(oracle.sql.BLOB, oracle.sql.BLOB) return oracle.sql.BLOB';
    end PDFTOOLS.pkg_pdf_utilities;
    /
    

    It's very basic, but doesn't seem to work. However, I want to my function from PL/SQL to a procedure that looks like this:

    CREATE OR REPLACE package PDFTOOLS.pkg_pdf_utilities
    as
    procedure sp_append_pdf (
              pio_pdf2append2   IN OUT NOCOPY blob
            , pio_pdf2append   IN OUT NOCOPY blob
      )
    end pkg_pdf_utilities;
    /
    

    What is important, what I'm trying to do is to NOCOPY the BLOBs. Otherwise, I have to read my PDF files into 2 BLOBs and create a 3rd blob as output. I prefer to be able to keep the pio_pdf2append2 as the final output. What I actually do call thing in a loop to gradually add a PDF file to a big. I'm not linking this in one operation because of concerns over the use of the system and because the pdfbox library java has would have been question after 850 in PDF format, which is not completely unrealistic in my approach.

    How could I achieve this?

    Post edited by: Pollocks01 only formatted code blocks because atlassian {code} tags didn't work.

    Passage of an argument as input/OUTPUT requires the mapping to a Java array.

    Simplified example that adds one FOR the other:

    create or replace and compile java source named blob_appender_src as
    import oracle.sql.BLOB;
    import java.sql.SQLException;
    import java.io.OutputStream;
    import java.io.InputStream;
    import java.io.IOException;
    
    public class BLOBAppender {
        public static void run (BLOB[] p1, BLOB p2) throws SQLException, IOException { 
    
            InputStream is = p2.getBinaryStream();
            OutputStream os = p1[0].setBinaryStream(p1[0].length()+1);                
    
            byte[] buffer = new byte[1024];
            int len;
            while ((len = is.read(buffer)) != -1) {
                os.write(buffer, 0, len);
            }
            os.close();
            is.close();
        }
    }
    
    create or replace procedure blob_append (
      p_lob1  in out nocopy blob
    , p_lob2  in            blob
    )
    as language java name 'BLOBAppender.run(oracle.sql.BLOB[], oracle.sql.BLOB)' ;
    /
    
    SQL> declare
      2    p_lob1  blob := utl_raw.cast_to_raw('ABC');
      3    p_lob2  blob := utl_raw.cast_to_raw('DEF');
      4  begin
      5    blob_append(p_lob1, p_lob2);
      6    dbms_output.put_line(utl_raw.cast_to_varchar2(p_lob1));
      7  end;
      8  /
    
    ABCDEF
    
    PL/SQL procedure successfully completed.
    
  • How to use the JKS-based Keystore in Oracle 11g SOA

    I'm doing FTPS on remote server of third party (with UNIX operating system) using SOA 11 g adapter FTP. I installed and configured vsftpd and generated vsftpd.pem file on the remote server certificate.
    Follow the steps mentioned in http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10231/adptr_file.htm#CIABDGCF

    In one step "Adjusting upward the FTP Oracle adapter" walletLocation is necessary, then I went through the steps mentioned in http://download.oracle.com/docs/cd/E17904_01/core.1111/e10105/wallets.htm#CHDGIJDC

    (Tried using both 1) JKS Keystore Management 2) portfolio management

    Impossible to find two of them in the Oracle 11g SOA em but the steps do not match.

    Can someone tell me how to use JKS Keystore or portfolio management?

    Thank you very much!!

    Concerning
    Yogesh

    Hi yogesh,

    I think that the portfolio can be created from the FMW console only if the HTTP server is installed and available. If there is no Oracle HTTP server, configure a specified in the.

    [http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14260/toc.htm |] Oracle HTTP Server installation]

    Agress,
    Neeraj Sehgal

  • How to use the Go buyback program?

    There is a program that restores your computer exactly what he had on it a while ago. I've used it before, but I don't remember how I got him. Can someone tell me the name of the program if it has changed, or how to access it?

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-system-restore

    What is system restore?

    http://www.bleepingcomputer.com/tutorials/tutorial143.html

    A very good tutorial on how to use the system restore is at the link above.

    Restore point:

    Do Safe Mode system restore, if it is impossible to do in Normal Mode.

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    See you soon.

    Mick Murphy - Microsoft partner

  • I have vista and how to record a program to a usb port to another user who has xp to use the program

    I have a samsung program for my phone, I installed and I have vista, I want to know how to record the program on a USB for another user may install and use the program, because they have a netbook with no cd it must be saved to the usb, but the other user has xp so please can you me how to record the program on usb

    Hello

    You cannot save a program that is installed on a USB key or any other

    Once installed a program spreads during the operating system at various locations

    You must download it again and save it on a USB flash drive, then transfer it to their netbook via a USB flash drive

    or get them to download it themselves directly to their netbook so they are available on the net

    For more information on the program, contact samsung

    http://www.Samsung.com/us/support/contact

  • I have paid the monthly fee and have been using Acrobat Pro DC.  I had a problem where I broke my previous laptop and want to continue to use this product.  I bought a laptop and I don't know how to download the program without havin

    I have paid the monthly fee and have been using Acrobat Pro DC.  I had a problem where I broke my previous laptop and want to continue to use this product.  I bought another laptop, and I don't know how to download the program without having to pay again.  I pay $14,99 per month for this service, how can I download it without having to pay again?

    Hello

    Please download Acrobat Pro ms of the here. After you download the application, install and activate it by providing your Adobe ID

    Thank you

    Abhishek

  • Photography plan Cloud creative student and Teacher Edition (one year) and no idea of how to get and start using the programs?

    So I just brought the creative plan Cloud photography student and Teacher Edition (one year) and no idea of how to get and start using the programs?

    Hello

    Go to creative.adobe.com and you identify with your Adobe ID

    From there, you can download the applications you purchased.

    Normally, you are taken there immediately after the purchase.

  • Hello! I have download CC and paid $69.99 but I want to use the programs that I pay for, why, if I pay $69.99, I have to use the test programs? you want to know what I pay and how I can get the services of programs I want to use.

    Hello! I have download CC and paid $69.99 but I want to use the programs that I pay for, why, if I pay $69.99, I have to use the test programs? you want to know what I pay and how I can get the services of programs I want to use.

    Miguelo28272279 for more information on how to solve the connection error preventing your membership to authorize please see sign, activation or connection errors. CS5.5 and later, Acrobat DC.  We invite you to update this discussion if you have any questions about the steps listed in the document.

  • How to use the RMI Stub class in programming?

    Hi all

    I'm new to the RMI.

    Can someone explain to me how to use the RMI Stub generated by calling command CRIM?
    For my tests, I can only call object rmi through its remote interface method. So what heel is when we are coding?

    I appreciate anyone's help.

    Thank you very much
    Xianyi.Ye

    When the remote object is committed to the registry, which is actually linked is the draft.

    So when the client performs a search in the registry, as it gets is the heel. However from the point of view of the customer, it's just a mystery object that implements the remote interface.

    So you must use it directly, it's all automatic.

  • Can not run the program "keytool": java.io.IOException

    Hello

    I would like to follow the procedure to change the password
    glassfish server hosting APEX earphone
    using the change key word subcommand of past, but the keytool utility
    not found:

    GlassFish@ahost:/opt/glassfish3/GlassFish/Domains/mydom01/config >/opt/glassfish3/bin/asadmin
    / opt/glassfish3/bin/asadmin
    Use "exit" to exit and online 'help' for help.
    asadmin > change of master-password mydom01
    Enter the current password > changeit

    Enter the new password > changedit

    Re-enter the new password > changedit

    Can not run the program "keytool": java.io.IOException: error = 2, no such file or directory
    Past change key word command failed.
    asadmin >
    Multimode command failed.
    GlassFish@ahost:/opt/glassfish3/GlassFish/Domains/mydom01/config > what java
    / usr/bin/Java
    GlassFish@ahost:/opt/glassfish3/GlassFish/Domains/mydom01/config >

    Glassfish entire works well outside it.

    keytool could be found in/usr/java/latest/bin/keytool.

    We need to have that in the path? There is no requirement in the
    Installation Guide for this, nor did the RPM installation adjust the system
    path accordingly.

    I hope someone can tell my how things should be in regards to keytool?

    Thank you, Tom

    Hi Tom,

    the procedure to change the password for the listener of glassfish server hosting APEX

    ... more like a topic related to GlassFish for me. I guess you will get the best answers to these questions in a GlassFish related forum...

    For what it's worth, I'll try my best even when:

    Can not run the program "keytool": java.io.IOException: error = 2, no such file or directory

    This seems to be a pretty clear error message: keytool , which probably is used to manage keys for users of GlassFish, was not found. This means, you are either running on an operating system that is not officially certified for GlassFish, or you GlassFish has not been configured correctly.
    You have run

    GlassFish@ahost:/opt/glassfish3/GlassFish/Domains/mydom01/config > which java
    / usr/bin/Java

    ... which means that you assume your GlassFish runs without being set JAVA_HOME. If that's true, I'm install you GlassFish correctly from this setting.
    Anyway, you have also discovered that

    keytool could be found in/usr/java/latest/bin/keytool.

    ... that is not + / usr / bin + and probably not in the way of global search of the user on whose behalf your GlassFish is running. Then, you can either create a link [*] for c++ / usr/bin/keytool + do (finally) to + / usr/java/more late/bin/keytool +, or you setup JAVA_HOME to be + / usr/java/last +.
    [*] Note that depending on your operating system, there may be more than one stage of indirection, for example my Ubuntu a + / usr/bin/java + pointing on + / etc/alternatives/java + which points on + / usr/lib/jvm/java-6-Sun/jre/bin/java + where + / usr/lib/jvm/java-6-Sun / + points to the directory containing the real JDK to use. You will probably find something like this on your system. My Ubuntu box has a link for + / usr/bin/keytool +, so I get when running "what keytool.

    We need to have that in the path? There is no requirement in the installation guide for that, nor the RPM installation has adjusted the path system accordingly.

    Again, this is not a forum of GlassFish.

    I hope my advice helps you solve your problem. If they are not, please choose the appropriate forum for your next post on this topic. And I guess, giving additional information about your OS and how you manage your JDK (and which version you use) help people here to help you.

    Thank you

    Udo

  • iMovie 10.1.2 today (June 4, 2016), all of a sudden will not let me create a new project/film.  1. I have used the program extensively in recent weeks, many small travel films. 2. once in the projects, if create a new movie and the sign is checked, the op

    1. I have used the program extensively in recent weeks, many small travel films.

    2. when in the projects, if you click on create a new movie and sign, the new movie and trailer options opens successfully.

    3. click on film, nothing goes very well but open trailer.

    4. the issue seems to be the only new film/project.

    5. I can access all my other movies and run successful projects and theatre.

    6. I tried through a previous project and clicking new project from the menu, but still nothing.

    7 mac is 27 "OS X El Capitan, Version free 10.11.5, with 327 GB to 999 GB

    iMovie is 10.1.2

    8. the computer itself did not fall down and as FAS as I know, all other programs work correctly.

    9. I rebooted several times, but that has not solved the problem.

    10A does anyone else have this problem? If so, how do fix you it?

    Thanks much for any help!

    Have you ever tried to delete the iMovie preferences?  If the elements of the user interface do not, deleting preferences frequently you contribute.

    To delete the iMovie preferences leaving iMovie, runs, and then press and hold options and command key at the same time, at the launch of iMovie. Keep now pressed the buttons firmly until you see a command prompt to remove the preference. Confirm.

    Before you do, take note of all the settings that you made in iMovie preferences panel, so you can put back them later. iMovie will then begin with the Welcome screen.

    When I had a similar problem, the only thing that helped was to create an iMovie library.  Probably a corrupted in the iMovie project current library prevented the creation.   The problem persists, if you test different library in iMovie? You can create a library for testing.

    http://help.Apple.com/iMovie/Mac/10.1/#/mov3fa25bae7

  • I'm not clear how to use the recovery CD

    I added all the space using my HDD is it comes about 12 GB, I have 27.9 GB of disk space, but my drive has only 1.80 left disk space. I made clear to solve this problem. Basket is empty, I ran disk cleanup.

    A computer expert suggested that Windows might have become confused and cannot recognize what place I save, it might be because I ran a program called Cyberscrub often. His solution is to reload Windows XP home. My laptop came with recovery discs, everything else is already loaded. I have so much I don't want to lose on my laptop. If I use the recovery discs, I will lose everything on my computer, am I better off buying Windows XP home and re-load, in which case I will not lose my job?

    Also I am not clear how to use the recovery discs, I can't find instructions on what you are doing.
    The only person who could help me went to travel and not reachable.
    Any help greatly appreciated
    Lorraine Hart

    It of a very simple to recover the laptop.
    Just boot from the recovery CD and follow the instructions on-screen ;)

    I put t know what version recovery CD you have, but the older one provides the standard and expert mode. In expert mode, you can choose you partition where the OS is to be installed.
    So in this case only the selected partition will be formatted!

    But have you checked the size of the HARD disk in disk management?
    Simply click on the my icon my computer and choose manage.

    Of course, you could remove the internal HARD disk and it could connect to the external USB HDD controller. Then, connect the drive HARD to the second PC and you record data on another HARD drive.

  • HOW TO USE THE FACES IN THE PHOTOS

    INSTRUCTIONS OR TUTORIAL ON HOW TO USE THE FACES IN THE MOST RECENT PROGRAM PHOTO ON MY MAC?

    I asked that your post be moved here:

    Photos for Mac

    See also:

    http://www.IMore.com/how-use-faces-photos-OS-x

  • How to use the Qosmio F50 Quad core HD processor in other software

    I would like learn how to use the image processor in other programs in addition to Toshiba Upconvert, transcoding, face Navigation and gesture of the functionality of the control. Someone has an idea? Thank you!

    I doubt that there are software available because the Cell processor is only a hand full of PC.

    If you have applications for creation of media professionals, you can get the plug-in to activate the cell processing.

  • Satellite U300 - how to use the recovery disk?

    I inserted the recovery disc 1 and then restarted my computer, but nothing happened.
    I really need to fix my cause cell it's time to review!

    Does anyone know how to use the recovery disk or affecting function press when the laptop starts to use the programmed recovery?

    Thank you!

    Hello!

    If you have inserted the recovery disc you must only start her everything that s!

    I m not sure but I think you can go into the advanced boot menu if you press F12. Alternative change you the boot priority in the BIOS. You can access BIOS by pressing F2.

    Good bye

Maybe you are looking for

  • How can I change the color of the hyperlink visited in Thunderbird?

    bold text

  • English french Exchange

    Hello world My name is Andre, I'm an old man of 45. I live in france, near Nantes. I love to travel around the world. I trie to learn English to myself, but it's not easy. I'm looking for someone would like to speak or write me in English. I can exch

  • Unknown device (TOS1900) on the Satellite A200

    Hi, I use Satellite A200 PSAE6EI installed vista 64-bit.When I look in Device Manager and select the option 'show hidden devices '. I see an unknown device.I tried to get with it, but I couldn't find anything, you know what? ACPI\TOS1900* TOS1900

  • How can Windows Picture and Fax Viewer - I specify the editing program?

    I set things up so that Windows Picture and Fax Viewer is the default program when I opened a variety of types of image files, which allowed me to get a quick overview without waiting for a program to load full image editing. What I need to be able t

  • c_209056.dll

    Recently, I deleted a virus 'Google re-direct' my XP PC running, using Hitman Pro 3.5. However, analyses after repeated Hitman Pro, "c_209056" is identified as a malware and Hitman apparently cannot delete this file - which I think may be the source