db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John English ...@brighton.ac.uk>
Subject Create function problem
Date Tue, 28 Feb 2006 22:16:00 GMT
I have a function to round a Double to a specified number of decimal places:

   public static final Double derbyDouble (Double value, Integer places) {
     ...
   }

I've declared it to Derby like so:

   CREATE FUNCTION DoubleFormat (value  FLOAT,
                                 places INTEGER)
   RETURNS FLOAT
   PARAMETER STYLE Java
   LANGUAGE Java
   EXTERNAL NAME 'utils.Utils.derbyDouble';

This works if I use "double" and "int" but not Double and Integer (as in,
the methos is found & used corrrectly if I use primitive types but it isn't
found if I use the corresponding wrapper types). I've also tried Float, which
is no better.

The big difference is that, using primitive types, I can't handle nulls...

Anyone got any ideas whhat I'm doing wrong?

----------------------------------------------------------------------
  John English              | mailto:je@brighton.ac.uk
  Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
  School of Computing & MIS | "Those who don't know their history
  University of Brighton    |  are condemned to relive it" (Santayana)
----------------------------------------------------------------------

Mime
View raw message