Hey, I'm trying to find a way to achieve this. I am using oracle 10g database where I have drops stored in a table. I want to read and pass blob to java method in my java code. I loaded my java class into my database via loadjava. The table in which my drops are stored is also set up.
This is my java class and the method I would like to pass BLOB
import java.lang.*;
import java.sql.*;
import oracle.sql.*;
public class Test
{
public static void getWidth(BLOB myBlob) throws Exception
{
System.out.println(myblob.length());
}
};
And this is my Java stored procedure (Wrapper) in PL / SQL
CREATE OR REPLACE PROCEDURE testmethod (p_blob IN BLOB)
AS LANGUAGE JAVA
NAME 'Test.getWidth(oracle.sql.BLOB)';
It loads the java class into the database, and my shell compiles and is also saved.
When I want to run execute testmethod(testphoto.jpg);
this gives me an error: 'testphoto.jpg must be declared'
Any recommendations for this? Thank you for your time.
This is my PL / SQL BLock from my testmethod:
DECLARE
P_FILE VARCHAR2(200);
P_BLOB BLOB;
BEGIN
P_FILE := NULL;
P_BLOB := NULL;
TESTMETHOD(
P_FILE => P_FILE,
P_BLOB => P_BLOB
);
END;
source
share