Real-world JSP advanced programming Three: Under Tomcat configuration Hibernate development environment

Source: Internet
Author: User
Tags mysql tomcat

This is the actual combat JSP advanced programming three.

Today spent a few hours, and finally the room inside the development of tomcat+hibernate, learning environment configured well.

Application scenarios: Tomcat 5.5, Hibernate 2.1.7, MySQL 3.23.43, MySQL driver:3.0.14, jdk:1.4.2 os:turbolinux Server 8.0

User environment: General Student Account--J2EE, location:/home/j2ee/public_html

For the convenience of beginners, this tutorial is specially simplified.

1. Add the jar copy from the Hibernate manual hibernate2.jar,dom4j,ehcache,cglib to web-inf/lib.

2. Will hibernate.cfg.xml copy into Web-inf inside.

Intranet users as long as the direct copy from the/home/j2ee/public_html/web-inf can be.

The outside reader also only needs to change the MySQL parameter in the hibernate.cfg.xml to be possible.

3. This example is a further simplification of the prevailing cat examples, with only 2 fields:

cat_id varchar, name varchar (50).

4. The following documents are available in WEB-INF/HB:

Cat.java

Cat.hbm.xml

Hibernateutil.java

5.2 JSP files for testing:

addcat.jsp

getcats.jsp

Related Article

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.