Implementing Promotions

Now you're ready to write the promotion class itself (see Listing 12.2).

Listing 12.2. Promotion.java
 package com.bfg.cart; import java.util.Vector; import java.util.HashMap; import java.util.Iterator; import java.text.NumberFormat; import com.bfg.product.Product; import com.bfg.product.Category; import org.apache.turbine.services.db.TurbineDB; import org.apache.turbine.util.db.pool.DBConnection; import org.apache.turbine.util.TurbineConfig; import com.bfg.exceptions.ProductActivityException; import java.sql.*; import java.util.ResourceBundle; public class Promotion { private static ResourceBundle sql_bundle = ResourceBundle.getBundle("com.bfg.cart.SQLQueries"); static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(Promotion.class); ...

Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.