Why do we code like this:

oql = db.getOQLQuery( "SELECT p FROM Product p WHERE Group=$" );
oql.bind( groupId );

results = oql.execute();
while ( results.hasMore() ) {
  Product prod;  
  prod = (Product) results.next();
  if( prod.getStockCount()>=10){
    prod.markDown( 0.25 );
    prod.setOnSale( true );
  }
}

if we can just execute the following SQL in JDBC:

update product p set p.on_sale = 1 
where p.stock_count >=10

?

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to