16.8. WEB-INF/classes/com/cybertrails/store/beans

This folder contains the CatalogBean class, which takes users through the products in the store, allowing them to view categories, subcategories, and products.

16.8.1. CatalogBean.java

 /* * CatalogBean.java */ package com.cybertrails.store.beans; import java.sql.*; import java.util.*; public class CatalogBean { String error; Connection con; public CatalogBean() {} //************GET CATEGORIES public ResultSet getCategories() throws SQLException, Exception { ResultSet rs = null; try { Statement getCategories; String s = new String("SELECT catid, catname FROM categories;"); getCategories = con.createStatement(); rs = getCategories.executeQuery(s); } catch (SQLException sqle) { sqle.printStackTrace(); ...

Get Java™ for ColdFusion® Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.