I overloaded the static method to match for the Procedure call and it seems to work just fine.
I think it would be nice-to-have a feature to add the jar file added by SQLJ.install_jar(..) automagically to the derby.database.classpath.
Anil Samuel wrote:
>>So you can't use CALL for a function. I sent the examples of a function
>>use earlier, using the VALUES or SELECT statements.
> I created a PROCEDURE using
> CREATE PROCEDURE dtp.TOTAL_LEAVE_FOR_TYPE (
> EMPLOYEE CHAR(80),
> LEAVE_TYPE_ID INT,
> OUT TOTAL_LEAVE INT)
> LANGUAGE JAVA
> EXTERNAL NAME 'oracle.dtp.derby.sample.LeaveHelper.TotalLeaveForType'
> PARAMETER STYLE JAVA;
Ok, I see now that you have three parameters here, missed that. Still an
OUT parameter does not map to the return of a Java method. Here is the
Java signature and code you need to match this procedure statement.
public static void TotalLeaveForType(String employee, int leaveTypeId,
// replace 'return total' with
totalLeave = total;
A procedure can have any number of INOUT or OUT parameters, so there is
no natural mapping to the returned value of the method. I believe this
all matches the SQL Standard part 13, Java routines in SQL.
Sorry for the confusion,