public void component(int M_Product_ID) throws Exception {
  if (p_implosion) {
    LevelNo+=1;
    PreparedStatement stmt=null;
    ResultSet rs=null;
    String sql="SELECT PP_Product_BOMLine_ID FROM PP_Product_BOMLine " + "WHERE IsActive = 'Y' AND M_Product_ID = ? ";
    try {
      stmt=DB.prepareStatement(sql,get_TrxName());
      stmt.setInt(1,M_Product_ID);
      rs=stmt.executeQuery();
      while (rs.next()) {
        parentImplotion(rs.getInt(1));
      }
      rs.close();
      stmt.close();
      LevelNo-=1;
      return;
    }
 catch (    SQLException e) {
      log.log(Level.SEVERE,e.getLocalizedMessage() + sql,e);
      throw new Exception("SQLException: " + e.getLocalizedMessage());
    }
 finally {
      DB.close(rs,stmt);
      rs=null;
      stmt=null;
    }
  }
 else {
    String sql="SELECT PP_Product_BOM_ID FROM PP_Product_BOM  " + "WHERE IsActive = 'Y' AND Value = ? ";
    PreparedStatement stmt=null;
    ResultSet rs=null;
    try {
      String Value=DB.getSQLValueString(get_TrxName(),"SELECT Value FROM M_PRODUCT WHERE M_PRODUCT_ID=?",M_Product_ID);
      if (Value == null) {
        throw new Exception(CLogger.retrieveErrorString("Error: PrintBOM.component()"));
      }
      stmt=DB.prepareStatement(sql,get_TrxName());
      stmt.setString(1,Value);
      rs=stmt.executeQuery();
      boolean level=false;
      while (rs.next()) {
        if (!level)         LevelNo+=1;
        level=true;
        parentExplotion(rs.getInt(1));
        LevelNo-=1;
      }
    }
 catch (    SQLException e) {
      log.log(Level.SEVERE,e.getLocalizedMessage() + sql,e);
      throw new Exception("SQLException: " + e.getLocalizedMessage());
    }
 finally {
      DB.close(rs,stmt);
      rs=null;
      stmt=null;
    }
  }
  return;
}

public void component ( int M_Product_ID ) throws Exception { if ( p_implosion ) { LevelNo += 1 ; PreparedStatement stmt = null ; ResultSet rs = null ; String sql = "SELECT PP_Product_BOMLine_ID FROM PP_Product_BOMLine " + "WHERE IsActive = 'Y' AND M_Product_ID = ? " ; try { stmt = DB . prepareStatement ( sql , get_TrxName ( ) ) ; stmt . setInt ( 1 , M_Product_ID ) ; rs = stmt . executeQuery ( ) ; while ( rs . next ( ) ) { parentImplotion ( rs . getInt ( 1 ) ) ; } rs . close ( ) ; stmt . close ( ) ; LevelNo -= 1 ; return ; } catch ( SQLException e ) { log . log ( Level . SEVERE , e . getLocalizedMessage ( ) + sql , e ) ; throw new Exception ( "SQLException: " + e . getLocalizedMessage ( ) ) ; } finally { DB . close ( rs , stmt ) ; rs = null ; stmt = null ; } } else { String sql = "SELECT PP_Product_BOM_ID FROM PP_Product_BOM  " + "WHERE IsActive = 'Y' AND Value = ? " ; PreparedStatement stmt = null ; ResultSet rs = null ; try { String Value = DB . getSQLValueString ( get_TrxName ( ) , "SELECT Value FROM M_PRODUCT WHERE M_PRODUCT_ID=?" , M_Product_ID ) ; if ( Value == null ) { throw new Exception ( CLogger . retrieveErrorString ( "Error: PrintBOM.component()" ) ) ; } stmt = DB . prepareStatement ( sql , get_TrxName ( ) ) ; stmt . setString ( 1 , Value ) ; rs = stmt . executeQuery ( ) ; boolean level = false ; while ( rs . next ( ) ) { if ( ! level ) LevelNo += 1 ; level = true ; parentExplotion ( rs . getInt ( 1 ) ) ; LevelNo -= 1 ; } } catch ( SQLException e ) { log . log ( Level . SEVERE , e . getLocalizedMessage ( ) + sql , e ) ; throw new Exception ( "SQLException: " + e . getLocalizedMessage ( ) ) ; } finally { DB . close ( rs , stmt ) ; rs = null ; stmt = null ; } } return ; }
find if this product as component
