Boleto Bancario impression with bar code

Perguntas relacionadas a questões técnicas do Oracle EBS. Criação de Concorrentes, Value Sets, Alerts, Forms Personalizations, Configurações, etc
Post Reply
User avatar
Porva
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 342
Joined: Mon, 29 Jan 2007 7:36 am
Location: São Paulo/SP
Rafael S. Nunes
São Paulo/SP

I got here using this tip:

before compiling the Java class in the bank, you will need to load the files jai_codec.jar and jars.jar ] to the bank.
http://www.dba-oracle.com/tips_oracle_sqlj_loadjava.htm

I copied the files jai_codec.jar and jars.jar into the UNIX via FTP , then loaded them to the database using the command below:

Select all

C:\oracle9i\bin>loadjava -user <user>/<password> jai_codec.jar
and

Select all

C:\oracle9i\bin>loadjava -user <user>/<password> JBARS.jar
Obs.: Replace the path c: \ oracle9i \ bin> of the example, by your Windows or UNIX directory.

Then I followed the steps shown in the previous messages to compile the Java class in the bank and create the function that will call this class and return the barcode.

Everything is right, you can test like this:

Select all

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;
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

You can import a Java class using the Loadjava command from the operating system.

Here is an example: 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 the 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 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 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:

Select all

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. Butt, Both The Source and Class Files Cannot Be Loaded at The Same Time.

Select all

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.

Select all

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:

Select all

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

Dropjava Can Be Used to Delete Java Objects from The Database. Theese 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 to PL / SQL Server Page (PSP).

Select all

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 the 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 Schema Other Than The Currently Connected User, Create Any Procedure and Create Any Table Privileges are required.

This example will use Simple Java Program That Will Be Compiled Outside of Oracle and Then Loaded Into The Database.

Select all

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


from or UNIX:

Select all

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:


Execute The Code from SQL * Plus:

Select all

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. Butt, Both The Source and Class Files Cannot Be Loaded at The Same Time.

Select all

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, format similar to TAR (on UNIX) and WinZip. The Contents of A Jar File Can Be Viewed Using These Popular Utilities. Java Developers Preferred to Distribute 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.

Select all

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:

Select all

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

Dropjava Can Be Used to Delete Java Objects from The Database. Theese 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 to PL / SQL Server Page (PSP).
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests