We've expanded our news coverage and improved our search! Visit news.oreilly.com for the latest or search for all things across O'Reilly!
advertisement

Weblog:   The Pet Store.... Again
Subject:   TMC != idiots?
Date:   2002-11-05 22:52:50
From:   anonymous2
Old app servers + Old Petstore != beta.Not


It is not that TMC was so stupid to use BMP when
CMP src was available:
http://java.sun.com/blueprints/code/jps13/src/index.html
but there BMP JDBC was so awful.Did this CRUD come from the original Petstore?: http://dreambean.com/petstore.html#bugs


They didnt use PreparedStatements:
sb.append(insertLineItemInsert);
lineItem = (LineItem) it.next();
if (lineItem == null)
throw new OrderDAOAppException("null");
int qty = lineItem.getQty();
String itemNo =lineItem.getItemNo().trim();


sb.append(lineItem.getLineNo());
sb.append(",'");
sb.append(itemNo);
sb.append("',");
sb.append(qty);
sb.append(",");
sb.append(lineItem.getUnitPrice());
sb.append(")");
queryStr = sb.toString();
ordStmt.addBatch(queryStr);
sb.delete(0, sb.length());
if(invROHome==null) { invROHome=EJBUtil.getInventoryROHome();
}


sb.append(updateInventoryUpdate);
sb.append(qty);
sb.append(" WHERE itemid = '");
sb.append(itemNo);
sb.append("'");
queryStr = sb.toString();
invStmt.addBatch(queryStr);
InventoryRO roBean = invROHome.findByPrimaryKey(itemNo);
roBean.getMutableDetails().reduceQty(qty);
sb.delete(0, sb.length());