title: USER defined java class step in pentaho data integration
body: <ul>
  <li><p>Hi,</p>
  
  <p>I am using the below code in USER DEFINED JAVA CLASS:</p>
  
  <pre><code> //STEP 1. Import required packages import java.sql.*;  
  import  org.pentaho.di.core.database.*;
    public class JDBCExample  {    
  // JDBC driver name and database URL      
    static final String JDBC_DRIVER = "com.mysql.jdbc.Driver"; 
        static final String DB_URL ="jdbc:mysql://localhost:1111/mysql";
  
   //  Database credentials    
         static final String USER = "USER"; 
         static final String PASS = "PASS";
       public static void main(String[] args) {    
       Connection conn = null;    
       Statement stmt = null;    try{
      //STEP 2: Register JDBC driver
      Class.forName("com.mysql.jdbc.Driver");
  
  
   //STEP 3: Open a connection
   System.out.println("Connecting to a selected database...");
   conn = DriverManager.getConnection(DB_URL, USER, PASS);
   System.out.println("Connected database successfully...");
  
   //STEP 4: Execute a query
   System.out.println("Creating statement...");
   stmt = conn.createStatement();
  
   String sql = "select id,sorname,src_databasetype,src_databasename from table";
   ResultSet rs = stmt.executeQuery(sql);
   //STEP 5: Extract data from result set
   while(rs.next()){
      //Retrieve by column name
      int id  = rs.getInt("id");
      String sorname = rs.getString("sorname");
      String src_databasetype = rs.getString("src_databasetype");
      String src_databasename = rs.getString("src_databasename");
  
      //Display values
      System.out.print("ID: " + id);
      System.out.print(", sorname: " + sorname);
      System.out.print(", src_databasetype: " + src_databasetype);
      System.out.println(", src_databasename: " + src_databasename);
   }
   rs.close();    }catch(SQLException se){
   //Handle errors for JDBC
   se.printStackTrace();    }catch(Exception e){
   //Handle errors for Class.forName
   e.printStackTrace();    }finally{
   //finally block used to close resources
   try{
      if(stmt!=null)
         conn.close();
   }catch(SQLException se){
   }// do nothing
   try{
      if(conn!=null)
         conn.close();
   }catch(SQLException se){
      se.printStackTrace();
   }//end finally try    }//end try    System.out.println("Goodbye!"); }//end main }//end JDBCExample 
  </code></pre>
  
  <p>Running the code through command prompt its working fine</p>
  
  <p>BUT on running the step(In PDI) alone I am getting error: 
  <strong>Non-abstract class "Processor" must implement method "boolean org.pentaho.di.trans.steps.userdefinedjavaclass.TransformClassBase.processRow(org.pentaho.di.trans.step.StepMetaInterface,
  org.pentaho.di.trans.step.StepDataInterface) throws
  org.pentaho.di.core.exception.KettleException"</strong></p></li>
  </ul>