我有 Apache 通用编解码器库,我需要在 Oracle 11 数据库中调用它,这样我就可以创建一个使用其中的类的 java 源,如下所示。
使这个库包含在数据库中的步骤是什么?
**代码需要实现但找不到符号
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);
}
} };