Home
Blog
Training
Course Schedule
Courses Offered
Corporate Training
Video Courses
Resources
Projects
Programs
Video Tutorials
My Favourites
Exam
Books
Books Read
Books Written
Testimonials
Feedback
FAQs
About
Integrating Struts With Hibernate Through DAO Pattern
I have developed a simple CRUD (Create Read Update and Delete) application using
Struts
as web framework,
Hibernate
for ORM and
DAO
(Data Access Object) design pattern.
Follow the steps given below to run this sample application using
NetBeans 6.5.
Download
struts_hib_crud.rar
.
Use
WinRar
to extract it to C:\ drive so that
c:\strut_hib_crud
folder is created, which contains the project.
When you open the project using NetBeans, it complains about missing references as libraries are removed from the .rar file to make download small.
Go to
properties
of the project and remove references to libraries using
Libraries
node in project properties window. Select library and click on
Remove
button.
Then add the following libraries to the project using
libraries
node. Use
Add Library
button or
Add JAR/Folder
button as the case may be.
Hibernate JPA
Struts 1.2.9
ojdbc14.jar for Oracle 10g
Build
project to make sure you have compiled all classes properly.
Deploy
the project. It starts Tomcat, if it is not already running.
Before you run project, create the following table in Oracle database in HR account.
create table subscribers ( email varchar(50) primary key, fullname varchar(50), dj date );
When you run the application, you get three options - List of Subscribers, Add New Subscriber and Delete Subscriber. List of subscribers displays the list of existing subscribers and allows you to modify the fullname of the subscriber using update form.