Hey I'm trying to find a way to get this running. I am using the oracle database 10g where I have blobs stored in a table. I want to be able to read out and pass a blob to a java method in my java code. I loaded my java class in my database via loadjava. The table where I store my blobs is set up, too.
This is my java class and the method I'd like to pass a 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 wrapper compiles and is stored as well.
When I want to run execute testmethod(testphoto.jpg);
it gives me the error: 'testphoto.jpg must be declared'
Any advice to get this running? Thanks for your time.
This is my PL/SQL BLock from my procedure 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;