3 Replies Latest reply on Jun 15, 2011 9:01 PM by 869186

    Mixing Java with Oracle Forms 11g

      What's going on is I wrote a program for work that allows the user to upload a document from their computer onto the database and then download it back later. Now I have to take that and integrate it into a button in Oracle Forms because our actual program runs from Forms. I imported the jar into the form and wrote a button with code I found online (modified slightly for my own use of course):

           jo ora_java.jobject;
           rv varchar(100);
           ex ora_java.jobject;

           JO := Upload.new;
           RV := Upload.startUploadPage(JO);
           WHEN ORA_JAVA.JAVA_ERROR then
                message('Unable to load Upload page, ' || ORA_JAVA.LAST_ERROR);
                ex := ORA_JAVA.LAST_EXCEPTION;
                message('Java Error');

      but when I tried to compile it I got:

      Error 306 at line 8, column 8
      wrong number or types of arguments in call to 'STARTUPLOADPAGE'

      the java method that is supposed to be called here is:

      public static String StartUploadPage() {

      new Upload();

      return Upload.StartUploadPage();

      I did get from someone that apparently as written my code wont work anyway because apparently the jar importer in Forms doesnt transfer UI (ie Java Swing) and that in order to get the UI to transfer I would have to write a JavaBean on top of my code... but 1 I have no clue what a JavaBean is and the research I have done so far about it has just confused me more... and 2 I'm not sure what that has to do with the error considering that the method that is supposed to be being called by the line that threw the error doesn't have any JFrames or Java Swing of any kind connected to it... there is a tiny bit of Swing in the class to open up the first form that has the buttons for upload and download in it but that is all. I have 4 classes in that jar... 3 are the various Java Swing pages and have the absolute minimum logic in them possible... and the 4th one is the one that starts everything going, has the main class, and any serious logic that needs to be done the needed values are passed to that class and that class does all the work... that 4th class is the one that is being called in the PL/SQL. If it isnt any trouble could I maybe get a little help from someone on:

      1. How to write a JavaBean to allow my program to work the way it is supposed to in Forms and

      2. Why I am getting this error and how to make it go away