MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL

Book description

JSP developers encounter unique problems when building web applications that require intense database connectivity. MySQL and JSP Web Applications addresses the challenges of building data-driven applications based on the JavaServer Pages development model. MySQL and JSP Web Applications begins with an overview of the core technologies required for JSP database development--JavaServer Pages, JDBC, and the database schema. The book then outlines and presents an Internet commerce application that demonstrates concepts such as receiving and processing user input, designing and implementing business rules, and balancing the user load on the server. Through the JDBC (Java DataBase Connector), the developer can communicate with most commercial databases, such as Oracle. The solutions presented in MySQL and JSP Web Applications center on the open source tools MySQL and Tomcat, allowing the reader an affordable way to test applications and experiment with the book's examples.

Table of contents

  1. Copyright
  2. About the Authors
  3. Acknowledgments
  4. Tell Us What You Think!
  5. An Introduction to Developing E-Commerce Applications with JSP
  6. JSP and JDBC
    1. A JSP/JDBC Review
      1. How Does JSP Work
      2. Running Tomcat
      3. Finding the Java Sources
      4. A Quick Look at JDBC and MySQL
      5. Working with ResultSets
      6. Using PreparedStatement
      7. Inserting, Deleting, and Updating
      8. Using Cursors
      9. Summary
    2. Java Beans and JSP
      1. Bean Basics
      2. Bean Persistence
      3. Application-Scoped Object and Singleton Classes
      4. Wrapping Up Beans
    3. Using Servlet Functionality with JSP
      1. Moving from CGI to Servlets
      2. Looking at an Example Servlet
      3. The End of the Beginning
  7. Sample Application: Functional Requirements
    1. The Sample Application Functional Requirements Document
      1. Welcome to Books for Geeks
      2. A High-Level View
      3. Diving into Design
      4. Summary
    2. Developing ERDs and Use Cases
      1. The Entity Relation Diagram
      2. Mining High-Level Use Cases Descriptions for Objects
      3. The User Class
      4. The Product Class
      5. The Shopping Cart and Order Classes
      6. Use Cases
      7. Moving Ahead
      8. Summary
    3. Creating the Database Schema and Populating Data
      1. The Fading Role of the DBA
      2. Building a Database Schema
      3. The Database from 20,000 Feet
      4. Summary
  8. Sample Application: Implementation
    1. Setting Up an Application's Infrastructure
      1. Build Management
      2. Logging and Database Connection Pooling
      3. Configuring Turbine
      4. Using Turbine Connection Pooling
      5. Using Log4J
      6. Customizing Log4J
      7. Getting Ready to Code
      8. Summary
    2. Retrieving, Storing, and Verifying User Input
      1. The Customer Class
      2. Reading and Writing Customers from the Database
      3. Cleaning Up the Code
      4. Accessing the Customer Class from JSP
      5. Field Validation
      6. Handling Forgotten Passwords
      7. Using Cookies to Store Login
      8. Moving On
    3. Publishing Data from Database Sources
      1. Looking at the Default Document Structure
      2. The Document Structure in Practice
      3. The Product and Category Classes
      4. The Author Object
      5. The Category Class
      6. Cleaning Things Up
      7. Summary
    4. Session Persistence and Complex Form Handling
      1. Implementing the Shopping Cart
      2. Buying More Than One Thing at Once
      3. Displaying and Editing the Shopping Cart
      4. Loose Ends
      5. The Next Step: Filling and Spilling
    5. Intersession Persistence
      1. Filling and Spilling
      2. The Address Book
      3. Credit Cards and the Wallet
      4. Time to Get Down to Business
    6. Implementing Business Logic
      1. Today Only! Buy One, Get One Free!
      2. Implementing Promotions
      3. Stubbing Out Taxes and Shipping
      4. Finalizing the Order
      5. Final Confirmation
      6. The Last Mile
    7. Completing the Application
      1. Charging the Credit Card
      2. About Credit Cards
      3. Completing the Order
      4. Order History
      5. In Retrospect
      6. Next Steps for the Site
      7. Dotting the I's and Crossing the T's
      8. Making It Turn-Key
      9. Resetting to a Clean State
      10. Summary, and on to the Advanced Stuff
  9. Advanced JSP Topics
    1. Integrating XML into e-Commerce Web Sites
      1. The Benefits of XML
      2. The Xerces XML Package
      3. A DTD for Products
      4. Writing a SAX Parser
      5. Writing a DOM Parser
      6. Generating XML
      7. Summary
    2. Using LDAP with JNDI
      1. The World of LDAP
      2. The LDAP Schema
      3. Getting LDAP'ed
      4. JNDI
      5. Testing LDAP Reading
      6. Testing LDAP Creation
      7. Trying Out LDAP Modification
      8. Running a Search Against LDAP
      9. Creating Your Own Schemas
      10. Summary
    3. The Struts Application Framework
      1. The MVC Pattern
      2. A First Look at Struts
      3. Setting Up Struts
      4. The struts-config.xml File
      5. The ActionForm
      6. The Action
      7. The Address Editing Page
      8. Two-Step Forms
      9. Configuring the Web Application Descriptor
      10. Summary
    4. Enterprise JavaBeans
      1. The Pros and Cons of EJB
      2. EJB in 30 Seconds
      3. Stateless, Stateful, and Entity Beans
      4. Setting Up JBoss
      5. Creating a Stateless Session Bean
      6. Being Stateful
      7. Talking to MySQL with Entity Beans
      8. A Final Goodbye to EJB
    5. Security, Load Balancing, Failover, and Other Considerations
      1. Security, Part 1
      2. Integrating with Apache
      3. Load Balancing
      4. Writing Applications for Multimachine Service
      5. The Failover Fallacy
      6. Database Tuning
      7. Security, Part 2 (SSL)
      8. The End of the Book
  10. Appendixes
    1. Getting and Installing JDK, Ant, and Tomcat
      1. Installing JDK Under Windows
      2. Installing JDK Under Linux
      3. Installing Ant Under Windows
      4. Installing Ant Under Linux
      5. Installing Tomcat Under Windows
      6. Installing Tomcat Under Linux
    2. Getting and Installing MySQL and JDBC for MySQL
      1. Installing MySQL on Windows
      2. Installing MySQL Under Linux
      3. Permissions and Security Under MySQL
      4. Installing JDBC Support for Tomcat
    3. A Books for Geeks Quickstart
      1. Installing the Books for Geeks Example in Windows
      2. Installing the Books for Geeks Example in Linux
  11. Index

Product information

  • Title: MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL
  • Author(s): James Turner
  • Release date: March 2002
  • Publisher(s): Sams
  • ISBN: 0672323095