ProdectServiceImpl
public class ProductServiceImpl implements ProductService {
ProductDao productDao = new ProductDaoImpl();
@Override
public List findHots() throws Exception {
// TODO Auto-generated method stub
return productDao.findHots();
}
@Override
public List findNews() throws Exception {
// TODO Auto-generated method stub
return productDao.findNews();
}
}
ProductDao
public interface ProductDao {
List findHots() throws Exception;
List findNews() throws Exception;
}
ProductDaoImpl
public class ProductDaoImpl implements ProductDao {
@Override
public List findHots() throws Exception {
// TODO Auto-generated method stub
String sql = “SELECT * FROM product WHERE pflag=0 AND is_hot=1 ORDER BY pdate DESC LIMIT 0,9;”;