| Autor |
Mensagem |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/04/2006 10:47:10
|
mariozupardo
Thread.start()
![[Avatar]](/images/avatar/c8993b923f72d010d71df.gif)
Membro desde: 25/09/2003 08:21:48
Mensagens: 45
Localização: São Paulo
Offline
|
Preciso escrever um código Java dentro de um Oracle form 6i.
Procedimento: tem uma procedure que irá gerar um arquivo, e a classe Java terá
que fazer download do arquivo (Já tenho um exemplo pronto de uma Servlet), eu preciso
embutir dentro do Forms.
Os forms estão rodando no IAS.
agradeço desde já.
Mario
|
Mario Zupardo |
|
|
 |
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/04/2006 10:56:51
|
boaglio
Moderador
![[Avatar]](/images/avatar/c0c7c76d30bd3dcaefc96f40275bdc0a.png)
Membro desde: 09/09/2002 21:23:39
Mensagens: 1865
Localização: Sampa City
Online
|
Acho a maneira mais fácil fazer em isso em Forms mesmo, usando o pacote dmbs_output e similares.
A Oracle dá suporte pra 6i ainda?
|
Tem dúvidas de Java? Poste no fórum! Não respondo dúvidas de Java via MP! |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/04/2006 11:30:07
|
mariozupardo
Thread.start()
![[Avatar]](/images/avatar/c8993b923f72d010d71df.gif)
Membro desde: 25/09/2003 08:21:48
Mensagens: 45
Localização: São Paulo
Offline
|
O arquivo que estou gerando está sendo gravado no Servidor, e eu preciso gravar na máquina do cliente que está rodando a aplicação.
Como eu posso fazer isto em Forms ?
Muito Obrigado.
Mario
boaglio wrote:
Acho a maneira mais fácil fazer em isso em Forms mesmo, usando o pacote dmbs_output e similares.
A Oracle dá suporte pra 6i ainda?
|
Mario Zupardo |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/04/2006 11:36:41
|
julianostr
GUJ Ranger
![[Avatar]](/images/avatar/ca7e09eacf1ae34bc819d495c5adfed9.jpg)
Membro desde: 31/03/2006 14:16:14
Mensagens: 855
Localização: Blumenau - SC
Offline
|
Vá lá no help do forms e procure por Text_IO, package responsável por tratar de arquivos.
|
LASER
Light Amplification by Stimulated Emission of Radiation |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/04/2006 11:59:17
|
julianostr
GUJ Ranger
![[Avatar]](/images/avatar/ca7e09eacf1ae34bc819d495c5adfed9.jpg)
Membro desde: 31/03/2006 14:16:14
Mensagens: 855
Localização: Blumenau - SC
Offline
|
Pesquisando meus arquivos aqui achei o texto abaixo. Veja se ajuda.
PURPOSE
-------
To Upload the data from a local client file to a TextItem or To
Save the contents of a TextItem to a local client file.
SCOPE & APPLICATION
-------------------
The code mentioned would work only with Forms 6i patch 5 and above,
due to Bug:1543274
The TEXT_IO package available with Forms would not help in this case,
since the TEXT_IO would act on the server files.
The solution mentioned here involves creating and using a Pluggable
Java Component (PJC). This PJC class would be used as an
Implementation class for the Text Item in Forms, by doing this we are
customizing the implementation of the Text Item.
a. Create the following file under $ORACLE_HOME\forms60\java
b. Compile the above program
Ensure the environment variable CLASSPATH contains
$ORACLE_HOME\forms60\java.
c:\>cd $ORACLE_HOME\forms60\java
e:\orant\forms60\java> javac TextPJC.java
c. Package the class file into a jar file
e:\orant\forms60\java> jar cvf TextPJC.jar TextPJC.class
The jar file needs to be signed, to provide the class file access to
the local filesystem.Check out the links mentioned below for more
information on signing a jar file
http://java.sun.com/security/signExample/
http://java.sun.com/security/usingJavakey.html
After signing the jar file you would have the certificate file
(Assume TextPJC.x509) which needs to be imported into the identity
database of the client system
d. Include the above signed jar file in the html file, by including
the jar file in the ARCHIVE tag of the applet
e. Setup the client to use the jar file
The certificate needs to be imported into the client's system & needs
to be trusted. This needs to be done using the javakey executable. The
above mentioned links would provide more information about it.
f. In the Form, Set the implementation class of the TextItem whose
data needs to be uploaded/saved from/to a file as "TextPJC". Make sure
the Jar file created is in the CLASSPATH, before invoking the forms
builder.
For reading a file content into the textitem use
set_custom_property('TEXT_ITEM',1,'readfile','filename');
Where TEXT_ITEM is the name of the Text Item and 'filename' is the
name of the file to be read.
For writing the contents of the textitem to a file use
set_custom_property('TEXT_ITEM',1,'writefile', 'filename');
Note :
- You could create a Bean to display a FileDialog to select the file.
- If you receive Security Exception even after trusting the jar file.
cd $JINITIATOR_HOME\lib\security ( JINITIATOR_HOME is home directory for
Jinitiator used. eg the default directory for Jinitiator v1.1.7.18 would be
c:\program files\oracle\Jinitiator1.1.7.1
Take a backup of the java.security file
Edit the java.security file and have only one entry for the identity.database
pointing to c:\\identitydb.obj
|
LASER
Light Amplification by Stimulated Emission of Radiation |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/04/2006 13:54:42
|
leandroeschiavi
Thread.start()
![[Avatar]](/images/avatar/7467fc45e24ec8d8b9023385c2a6066d.jpg)
Membro desde: 18/04/2006 11:59:44
Mensagens: 34
Localização: São Paulo
Offline
|
Ou ainda vc tem a opção de criar uma JSP (Java Stored Procedure) dentro do banco Oracle e realizar a chamada a partir do forms !
Acho bem interessante esta saída e mais otimizada !
|
Leandro Eschiavi
ORACLE CONSULTANT
Sun Certified Java Programmer 5.0 |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/04/2006 14:24:56
|
boaglio
Moderador
![[Avatar]](/images/avatar/c0c7c76d30bd3dcaefc96f40275bdc0a.png)
Membro desde: 09/09/2002 21:23:39
Mensagens: 1865
Localização: Sampa City
Online
|
leandroeschiavi wrote:Ou ainda vc tem a opção de criar uma JSP (Java Stored Procedure) dentro do banco Oracle e realizar a chamada a partir do forms !
Acho bem interessante esta saída e mais otimizada !
Mais interessante sem dúvida, mas mais otimizada pouco provável.
Qualquer coisa em Java dentro do Oracle é muito mais lento do que
PL/SQL. As rotinas do text_io são chamadas do PL/SQL, mas chamam
rotinas nativas em C, o que sem dúvida é bem rápido.
|
Tem dúvidas de Java? Poste no fórum! Não respondo dúvidas de Java via MP! |
|
|
 |
|
|