Problems using Java classes in Oracle Database

5

I'm having trouble using Java classes a little "complex " in Oracle . When I use a simple class, as an example below:

 CREATE JAVA SOURCE NAMED "Welcome" AS
   public class Welcome {
      public static String welcome() {
         return "Welcome World";   
      } 
   }

It works perfectly, but when it's a class I need to instantiate an object from a lib, I have problems and I can not use the class, and with PL / SQL Developer , my class compiles only with error, and with great difficulty I identified that the error in the hour that instancio the class. The code is as follows:

CREATE JAVA SOURCE NAMED "Importar" AS
public class Importar
    import org.pentaho.di.trans.Trans;
    import org.pentaho.di.trans.TransMeta;

    public static String void executar(String arquivo) throws IOException
    {
         Trans trans; // AQUI TENHO O ERRO...
         TransMeta transMeta = new TransMeta(this.loaderName); 
         trans = new Trans(transMeta); 
         ...
         return "resultado...";
    }

The problem is that in the PL / SQL Developer tool, I could only identify the error because I was commenting the code line by line and only when I commented the one of the Trans object, the code compiled without errors.

asked by anonymous 14.08.2014 / 18:47

1 answer

1

@EricoSouza sure this compiled out of Oracle? For example, this:

public class Importar
 import org.pentaho.di.trans.Trans;
 import org.pentaho.di.trans.TransMeta;

I believe that if it works with the simple example class, then the error is its class. Would not that be correct?

import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.TransMeta;

public class Importar{
//...
}

The import s must be before the class definition and the class must open { and close } .

    
20.02.2015 / 07:21