Mirek Cervenka wrote:
Hello,
I have a following problem. I want to return a result set as a
consequence of some processing by a Java stored procedure on Apache
Derby DB, however, I am still getting a NULL resultset. Could anyone
help me please? I would be very grateful!
Here is the code. Registration of the stored procedure is as follows:
CREATE PROCEDURE myTestProcedure() LANGUAGE JAVA PARAMETER STYLE JAVA
CONTAINS SQL DYNAMIC RESULT SETS 1 EXTERNAL NAME
'StoredProcedures.myTestProcedure'
The actual implementation of the stored procedure is:
public static void myTestProcedure(ResultSet[] rs) {
try {
Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
} catch (Exception ex) {
ex.printStackTrace();
}
There's no need to load any JDBC driver in a server side procedure.
You may find this wiki page useful:
http://wiki.apache.org/db-derby/DerbySQLroutines
Dan.