Struts1.2 to implement MySQL database paging

Source: Internet
Author: User

My platform is: Eclipse3.2 MyEclipse5.5 Tomcat5.5 MySql5.0

First step: Create a database:

It's no hard work, just use the script below to make it OK.

CREATE DATABASE page;
use page;
CREATETABLE `product` (
`id` varchar(11) NOTNULL,
`sortid` varchar(11) NOTNULL,
`name` varchar(50) NOTNULL,
`price` doubleNOTNULL,
`saleprice` doubleNOTNULL,
`descript` text NOTNULL,
`contents` text NOTNULL,
`saledate` varchar(255) NOTNULL,
`salecount` int(11) defaultNULL,
`image` text,
PRIMARYKEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Step Two: Create a project

Create a project, project name "Strutspage", import Struts1.2, struts package defaults, reference MySQL driver, if there is no driver, please go to http://download.csdn.net/source/400716 this download.

The following settings Web.xml and struts-config.xml configuration files, I think directly copy my good.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.