Results 1 to 1 of 1
  1. #1
    Join Date
    Jan 2004
    Posts
    14

    Angry Unanswered: ORA-29531: no method

    I am a newbie to this forum and i have a problem here. I have written a class with a methods in it.

    The class compiled perfectly using jbuilder and was loaded into Oracle via loadjava with the -thin options.

    The method has been published as a procedure in oracle. When i try i get oracle error ORA-29531: no method...in the class ...

    Is it because we cannot use JDBC in oracle stored procedures?

    Here is the user and tables i have created:-

    CREATE USER "TESTING" PROFILE "DEFAULT"
    IDENTIFIED BY "testing" DEFAULT TABLESPACE "USERS"
    ACCOUNT UNLOCK;
    GRANT "CONNECT" TO "TESTING" WITH ADMIN OPTION;
    GRANT "DBA" TO "TESTING" WITH ADMIN OPTION;
    GRANT "EXP_FULL_DATABASE" TO "TESTING" WITH ADMIN OPTION;
    GRANT "IMP_FULL_DATABASE" TO "TESTING" WITH ADMIN OPTION;
    GRANT "RESOURCE" TO "TESTING" WITH ADMIN OPTION;

    CREATE TABLE TABLE1 ("ID" VARCHAR2(10) NOT NULL, "TYPE"
    VARCHAR2(10) NOT NULL);

    This is my java code:-

    public class testing {

    public static void test(String para)
    {
    try{
    java.lang.ClassLoader classLoader = java.lang.ClassLoader.getSystemClassLoader();
    Class driverClass = classLoader.loadClass("oracle.jdbc.OracleDriver");
    java.sql.Driver driver = (java.sql.Driver) driverClass.newInstance();
    java.sql.DriverManager.registerDriver(driver);
    java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:oracle: thin:@server:1521:DB", "TESTING", "TESTING");
    java.sql.Statement statement = connection.createStatement();
    String sql = "";
    sql = "INSERT INTO TESTING.TABLE1 (ID,TYPE) VALUES ('"+ para +"' , NULL )";
    statement.execute(sql);
    statement.close();
    connection.commit();
    connection.close();
    }catch (Exception e){
    e.getMessage();
    }

    }
    }

    Here is how i publish it:-

    create or replace procedure test(para char)as language java name 'testing.test(String)';


    And here is how i called it via SQLPlus:-

    call test('HI');

    ERROR at line 1:
    ORA-29531: no method test in class testing

    Could someone enlighten me on this... thanks!
    Last edited by vyruzj; 01-15-04 at 22:27.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •