function in derby[beginner]

Discussion in 'Java' started by tony_se, Mar 31, 2007.

  1. tony_se

    tony_se Guest

    I have this class:
    public class Say {
    public static int say(int i) {
    System.out.println("* Say: " + i);
    return i;
    }

    public static int say2(String msg) {
    System.out.println("** " + msg);
    return 1;
    }
    }

    and I created a function in Derby:
    create function say2(msg varchar(50)) returns integer
    parameter style java no sql language java
    external name 'Say.say2';

    but when I want to use it, error occurs:
    ERROR 42X50: No method was found that matched the method call
    Say.say2(java.lang
    ..String), tried all combinations of object and primitive types and any
    possible
    type conversion for any parameters the method call may have. The
    method might e
    xist but it is not public and/or static, or the parameter types are
    not method i
    nvocation convertible.

    And I created another function:
    create function say(i integer) returns integer
    parameter style java no sql language java
    external name 'Say.say';

    It works fine.

    I've tried hard to figure it out but failed. Can anybody help me?

    Thank you in advance!!!
     
    tony_se, Mar 31, 2007
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris
    Replies:
    3
    Views:
    4,619
    IchBin
    Jul 7, 2005
  2. rySource

    netbeans rc2 derby driver error

    rySource, Jan 21, 2006, in forum: Java
    Replies:
    0
    Views:
    998
    rySource
    Jan 21, 2006
  3. 3rdshiftcoder

    hibernate w/derby simple crud

    3rdshiftcoder, Jan 7, 2007, in forum: Java
    Replies:
    1
    Views:
    3,067
    3rdshiftcoder
    Jan 7, 2007
  4. tony_se

    [beginner]Trigger in Derby

    tony_se, Mar 29, 2007, in forum: Java
    Replies:
    1
    Views:
    702
    Oliver Wong
    Apr 3, 2007
  5. Wills
    Replies:
    0
    Views:
    497
    Wills
    Jul 9, 2007
  6. Wills
    Replies:
    3
    Views:
    1,153
    Wills
    Jul 10, 2007
  7. Replies:
    1
    Views:
    1,289
    Ian Wilson
    Jul 17, 2007
  8. gert
    Replies:
    5
    Views:
    3,890
    Roedy Green
    Sep 27, 2007
Loading...