Impressao de Boleto Bancario com codigo de barras

Perguntas relacionadas a questões técnicas do Oracle EBS. Criação de Concorrentes, Value Sets, Alerts, Forms Personalizations, Configurações, etc
  

Mensagemem Qua, 27 Dez 2017 2:12 pm

consegui aqui usando essa dica:

antes de compilar a classe Java no banco, será preciso carregar os arquivos jai_codec.jar e JBARS.jar para o banco.

http://www.dba-oracle.com/tips_oracle_sqlj_loadjava.htm

copiei os arquivos jai_codec.jar e JBARS.jar para dentro do Unix via FTP, aí carreguei eles para o banco de dados usando o comando abaixo:

Código: Selecionar todos
C:\oracle9i\bin>loadjava -user <user>/<password> jai_codec.jar

e

Código: Selecionar todos
C:\oracle9i\bin>loadjava -user <user>/<password> JBARS.jar


Obs.: substitua o caminho C:\oracle9i\bin> do exemplo, pelo seu diretório Windows ou Unix.

depois segui os passos mostrados nas mensagens anteriores para compilar a classe Java no banco e criar a função que irá chamar essa classe e retornar o código de barras.

tudo estando certo, você poderá testar assim:

Código: Selecionar todos
SELECT generate_barcode_f( p_code  => '64731136' -- Numeros do código de barras
                          ,p_tipo  => 'CODE93'   -- 'CODE128','CODE93' ou 'INTER25'
                          ,p_sizeY => '50')      -- Tamanho da imagem (altura), ex: 50
  FROM DUAL;
Porva
Localização: São Paulo/SP

Rafael S. Nunes
São Paulo/SP

Mensagemem Qui, 04 Jan 2018 10:31 am

Você pode importar uma classe java usando o comando LOADJAVA do sistema operacional.

Aqui tem um exemplo:
http://www.dba-oracle.com/tips_oracle_sqlj_loadjava.htm

The SQLJ loadjava Utility
The loadjava utility (in Oracle 8.1.5 and up) loads Java source and class files into the database. When class files are created in a conventional manner, outside the database, loadjava is used to get them into the database.

loadjava requires two database privileges to load java objects into your own schema: CREATE PROCEDURE and CREATE TABLE. To load Java objects into a schema other than the currently connected user, CREATE ANY PROCEDURE and CREATE ANY TABLE Oracle privileges are required for the loadjava user.

This example will use a simple Java program that will be compiled outside of Oracle and then loaded into the database.

see loadjava script download

The class file is now loaded into the database and visible from the dba_objects view with an object type of JAVA CLASS.

From SQL*Plus, create the PL/SQL wrapper to invoke the newly loaded Java class:


SQL> create or replace procedure call_simplejava
2 as language java
3 name 'SimpleJava.showMessage()';
4 /

Execute the code from SQL*Plus:

SQL> set serveroutput on;
SQL> call dbms_java.set_output(50);

Call completed.

SQL> execute call_simplejava;
Here we are

PL/SQL procedure successfully completed.

In this example, the Java class file was loaded into the database. The Java source file can also be loaded. But, both the source and class files cannot be loaded at the same time.

C:\oracle9i\bin>loadjava -user scott/tiger SimpleJava.java

If loading many Java class files at one time, it is advisable to put them in a JAR file and load them into the database at one time, since the loadjava program will also load JAR files. loadjava provides many command line options for the Java developer. The complete list can be viewed by typing loadjava at the command line.

Just as loadjava loads the database with our Java files or classes, the dropjava utility deletes them. In the example below, the class file that was loaded with loadjava is removed. And just like loadjava, it will drop Java source, Java classes, or JAR files.

C:\oracle9i\bin>dropjava -u scott/tiger SimpleJava.class

Alternatively, instead of using the command line utility, you can call a package that will do the same thing:

SQL> call dbms_java.dropjava('... options...');

Dropjava can be used to delete Java objects from the database. These Java objects may have been loaded into the database through the loadjava utility. The next utility also loads code into the database; only instead of Java, it loads a PL/SQL Server Page (PSP).

loadjava script download

The SQLJ Utility Loading and Dropping Java Objects

The loadjava utility (Oracle 8.1.5 and up) loads Java source and class files into the database. When class files are created in a conventional manner, outside the database, loadjava is used to get them into the database.

loadjava requires two database privileges to load java objects into your own schema: CREATE PROCEDURE and CREATE TABLE. To load Java objects into a schema other than the currently connected user, CREATE ANY PROCEDURE and CREATE ANY TABLE privileges are required.

This example will use a simple Java program that will be compiled outside of Oracle and then loaded into the database.

public class SimpleJava {

public void main(String[] args) {
System.out.println("Here we are");
}

From DOS or UNIX :

C:\oracle9i\bin>javac SimpleJava.java

C:\oracle9i\bin>loadjava -user scott/tiger SimpleJava.class

The class file is now loaded into the database and visible from the dba_objects view with an object type of JAVA CLASS.

From SQL*Plus, create the PL/SQL wrapper to invoke the newly loaded Java class:

SQL> create or replace procedure call_simplejava
2 as language java
3 name 'SimpleJava.showMessage()';
4 /

Execute the code from SQL*Plus:

SQL> set serveroutput on;
SQL> call dbms_java.set_output(50);

Call completed.

SQL> execute call_simplejava;
Here we are

PL/SQL procedure successfully completed.

In this example, the Java class file was loaded into the database. The Java source file can also be loaded. But, both the source and class files cannot be loaded at the same time.

C:\oracle9i\bin>loadjava -user scott/tiger SimpleJava.java

If loading many Java class files at one time, it is advisable to put them in a JAR file and load them into the database at one time, since the loadjava program will also load JAR files. A JAR file is a group of Java class files lumped into one file, a format similar to TAR (on UNIX ) and WinZip (on Windows). The contents of a JAR file can be viewed using these popular utilities. Java developers prefer to distribute a few JAR files rather than many individual Java class files.

loadjava provides many command line options for the Java developer. The complete list can be viewed by typing loadjava at the command line.

Just as loadjava loads the database with our Java files or classes, the dropjava utility deletes them. In the example below, the class file that was loaded with loadjava is removed. And just like loadjava, it will drop Java source, Java classes, or JAR files.

C:\oracle9i\bin>dropjava -u scott/tiger SimpleJava.class

Alternatively, instead of using the command line utility, you can call a package that will do the same thing:

SQL> call dbms_java.dropjava('... options...');

Dropjava can be used to delete Java objects from the database. These Java objects may have been loaded into the database through the loadjava utility. The next utility also loads code into the database; only instead of Java, it loads a PL/SQL Server Page (PSP).
dr_gori
Localização: Seattle, WA, USA

Thomas F. G


Anterior

Voltar para EBS Técnico

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 3 visitantes