Calling Java Class Forms.

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Post Reply
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Guys, beleza?

I did a tests here by playing a Java code (a class) on the bank and, performing the class call via procedure and function.
So far so good, it worked normally as long as I did not use Java graphic resources, like the swing.

Important note: Manjo nothing Java!

But, I have a question: how, via Forms (6i - Version 6.0.8.27.0), I call a Java class that is on my operating system, not in the bank?

Positive case if they have any example or link indication, thank you.

Thank you very much.
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

Dude I develop in Java and I have the same problem of yours.

In my case I do not even need Java to be incorporated into the forms or report, it just needs to call my Java app passing parameters.

But I did not find anything that worked.
rafaellomba
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 21
Joined: Tue, 14 Aug 2007 9:39 am
Location: Rio de Janeiro - RJ
Rafael Lomba

Hello everyone,

I do not know if this is what Trevisolli is talking about, but there is the host command in the forms that you can run any windows command line and how a java file runs via line I think it can be solved like this.

Host ('Windows command')
Example:

Select all

HOST('java c:\projetos\classe1.class')
I just do not know if the Command to call the Java file is correct.

I hope I could have helped.

Hugs.
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

Dude, I'm also needing this feature, I had thought of something like a build-in, but this command will already help a bit.
Just a question: Does this command also work on Reports? Because I have a report that I need to call a chart from it.

another thing, to correctly call a Java app Ideal is that this app is built in format .jar and to call it does this:

Select all

 
java -jar meuAppJava.jar 
If someone needs more help in Java just look for me.

vlw.
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Speak Pyro, beleza Brother?

So, pro forms, I do not know if you'vê heard ...
I'vê heard, but, I did not use it, a type of item "Bean area".

I believe it is to work with Java class in Forms.

If anyone has already used this way and can guide us.
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

I'vê tried to use it, but it did not work at all. :-O
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

I tested the Host () command here but only flashes a screen and does not call my application.
Does anyone have any tips?
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

Completing the previous post, when flashing on the screen appears written

Select all

 
unable to java archive 
I tested and both the paths and the JVM are correct in the machine, does anyone know if the host () presents some restriction?
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Brother, a tip would be to use in this form of the forms (his Help) form.

See the return of the error presented if it is OMESMO previously informed:

Select all

 
 
** built-in:  HOST 
** Example:   Execute an operating system command in a  
**            subprocess or subshell. Uses the  
**            'Get_Connect_Info' procedure from the  
**            GET_APPLICATION_PROPERTY example.  
*/  
PROCEDURE Mail_Warning( send_to VARCHAR2) IS  
  the_username VARCHAR2(40);  
  the_password VARCHAR2(40);  
  the_connect  VARCHAR2(40);  
  the_command  VARCHAR2(2000);  
BEGIN  
  /*  
  ** Get Username, Password, Connect information  
  */  
  Get_Connect_Info(the_username,the_password,the_connect);  
  /*  
  ** Concatenate together the static text and values of  
  ** local variables to prepare the operating system command  
  ** string.  
  */  
  the_command := 'orasend '||  
      ' to='||send_to||  
      ' std_warn.txt '||  
      ' subject="## LATE PAYMENT ##"'||  
      ' user='||the_username||  
      ' password='||the_password||  
      ' connect='||the_connect;  
  
  Message('Sending Message...', NO_ACKNOWLEDGE);  
  Synchronize;  
  /*  
  ** Execute the command string as an O/S command The  
  ** NO_SCREEN option tells forms not to clear the screen  
  ** while we do our work at the O/S level "silently".  
  */  
  Host( the_command, NO_SCREEN );  
  /*  
  ** Check whether the command succeeded or not  
  */  
  IF NOT Form_Success THEN  
    Message('Error -- Message not sent.');  
  ELSE  
    Message('Message Sent.');  
  END IF;  
END;  
makes some adaptations there, and whatever sends us to us.
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

Dude, as I am using Windows Vista here the Forms Builder is very unstable.
It was only to restart the PC that worked.

vlw.
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

beleza BROTHER.

Just to leave here so that the others also know, in case you need:

- Did you perform the call only with Host ?

Valeu.
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

Yes, it was only using a host and was as follows:

Select all

 
host('java -jar \\meu_caminho\meu_app.jar')
It was only that.

It was not built-in as I wanted but is running, it's better than nothing.
alfredofonseca
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Wed, 13 Jun 2007 5:31 pm
Location: Goiânia
NM Alfredo Fonseca
Analista de sistemas
62 84740311

Use Java Bean Area ..

Search more on this
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

I already researched and tested but did not work in content, so I adopted another same solution.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests