You don't need the schema name in the EXTERNAL NAME clause. The INSTALL_JAR and SYSCS_SET_DATABASE_PROPERTY calls wire together a custom classpath for your database. All of the classes in the installed jar files will appear to your database session as though they are on your classpath. So you just need to refer to classes by their ordinary class names.

Try the following (assuming that TestListener lives in the root of the package space):

CREATE procedure extract_keyword (test VARCHAR(100))   LANGUAGE JAVA
PARAMETER STYLE JAVA  NO SQL EXTERNAL NAME 'TestListener.capitalize';

Hope this helps,
-Rick

On 9/12/19 5:14 PM, fkalim wrote:
To give more information, I compile my code into a jar, install the jar and
then try to use the Java file in the jar. The name of the java class is
TestListener. When I use the sql code below, I get the error:

ERROR 42X51: The class 'APP.TestListener' does not exist or is inaccessible.
This can happen if the class is not public or the derby.database.classpath
property is missing or incorrectly defined.
ERROR XJ001: Java exception: 'APP.TestListener:
java.lang.ClassNotFoundException'.

SQL:

CALL SQLJ.INSTALL_JAR('<path>/listener.jar', 'APP.TestListener', 0);

CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY( 'derby.database.classpath',
'APP.TestListener');

CREATE procedure extract_keyword (test VARCHAR(100))   LANGUAGE JAVA
PARAMETER STYLE JAVA  NO SQL EXTERNAL NAME 'APP.TestListener.capitalize';




--
Sent from: 
http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html


Reply via email to