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. Advertising

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,454
    IchBin
    Jul 7, 2005
  2. rySource

    netbeans rc2 derby driver error

    rySource, Jan 21, 2006, in forum: Java
    Replies:
    0
    Views:
    885
    rySource
    Jan 21, 2006
  3. tony_se

    [beginner]Trigger in Derby

    tony_se, Mar 29, 2007, in forum: Java
    Replies:
    1
    Views:
    643
    Oliver Wong
    Apr 3, 2007
  4. Wills
    Replies:
    0
    Views:
    387
    Wills
    Jul 9, 2007
  5. Wills
    Replies:
    3
    Views:
    990
    Wills
    Jul 10, 2007
Loading...

Share This Page