learntechnology.netsimplifying information technology |
struts2-hibernate source code struts2-hibernate.war Introduction
Hibernate is a popular and powerful ORM(Object Relational Mapping) Framework. When you
dealing with the database programming, it can significantly speed up your
productivity and simplify the procedure of development. In this application I will show you how struts2 and hibernate3 work together and how simple it is to add hibernate to our struts2crud project.
Requirements
This application requires an application server that
implements the Servlet 2.4 and JavaServer Pages 2.0 specifications. The
example has been tested on Tomcat 5.x and Tomcat 6.0
Database Setup
We use MySQL5 as our database in this application. Be sure you've installed the correct version of MySQL and it is running before you create our example database.
Creating example database and loading sample data
Important: Remember that replaces to your own MySQL database username and password of the hibernate.cfg.xml file. You can find the hibernate.cfg.xml under \web-inf\classes after Tomcat unpack the war file. I highlight them below on the hibernate.cfg.xml. Unless you've done this,the hibernate won't work properly. hibernate.cfg.xml
(Rest of lesson coming soon. For a sample Strut2 CRUD application without using hibernate see my Struts2 CRUD lesson.)
|
|