I've the Apache common codecs library & I need to invoke that in the Oracle 11 database so I can create a java source that utilize the classes inside it as below.
What are the steps to make this library included in the database?
**Code need to achieved but giving symbol Can't be found
CREATE OR REPLACE JAVA SOURCE NAMED "org_apache_Base64" AS
import java.lang.*;
import java.sql.*;
import oracle.sql.*;
import java.io.*;
import javax.xml.bind.DatatypeConverter;
import org.apache.commons.codec.binary.Base64;
public class org_apache_Base64
{
public static void ExportBlob(String CONTFILE, BLOB CONTBLOB) throws Exception
{
try
{
File file = new File("/u01/oracle/jam_export/contract1");
FileOutputStream fos = new FileOutputStream(file);
byte[] encodedBytes = Base64.getEncoder().encode("Test".getBytes());
System.out.println("encodedBytes " + new String(encodedBytes));
byte[] decodedBytes = Base64.getDecoder().decode(encodedBytes);
System.out.println("decodedBytes " + new String(decodedBytes));
System.out.println("PDF File Saved");
fos.write(decoded);
fos.flush();
fos.close();
}
catch (Exception e)
{
System.out.println(e);
}
} };