protected String doIt() throws Exception {
  ArrayList<Object> params=new ArrayList<Object>();
  String sql="SELECT p.M_Product_ID FROM M_Product p WHERE p.AD_Client_ID=?";
  params.add(m_AD_Client_ID);
  if (p_M_Product_Category_ID > 0) {
    sql+=" AND p.M_Product_Category_ID=?";
    params.add(p_M_Product_Category_ID);
  }
  PreparedStatement pstmt=null;
  ResultSet rs=null;
  try {
    pstmt=DB.prepareStatement(sql,get_TrxName());
    DB.setParameters(pstmt,params);
    rs=pstmt.executeQuery();
    while (rs.next()) {
      int M_Product_ID=rs.getInt(1);
      createPlanning(M_Product_ID);
    }
  }
 catch (  SQLException e) {
    throw new DBException(e,sql);
  }
 finally {
    DB.close(rs,pstmt);
    rs=null;
    pstmt=null;
  }
  return "@Created@ #" + count_created + " @Updated@ #"+ count_updated+ " @Error@ #"+ count_error;
}

protected String doIt ( ) throws Exception { ArrayList < Object > params = new ArrayList < Object > ( ) ; String sql = "SELECT p.M_Product_ID FROM M_Product p WHERE p.AD_Client_ID=?" ; params . add ( m_AD_Client_ID ) ; if ( p_M_Product_Category_ID > 0 ) { sql += " AND p.M_Product_Category_ID=?" ; params . add ( p_M_Product_Category_ID ) ; } PreparedStatement pstmt = null ; ResultSet rs = null ; try { pstmt = DB . prepareStatement ( sql , get_TrxName ( ) ) ; DB . setParameters ( pstmt , params ) ; rs = pstmt . executeQuery ( ) ; while ( rs . next ( ) ) { int M_Product_ID = rs . getInt ( 1 ) ; createPlanning ( M_Product_ID ) ; } } catch ( SQLException e ) { throw new DBException ( e , sql ) ; } finally { DB . close ( rs , pstmt ) ; rs = null ; pstmt = null ; } return "@Created@ #" + count_created + " @Updated@ #" + count_updated + " @Error@ #" + count_error ; }
create data planning record
