You are on page 1of 1

Instructions for creating and executing Hibernate

with Struts+Maven (Example:


Struts2Hibernate.war)
1. Create a Dynamic web project and immediately configure that with Maven
by

making a right click on project name on the left pane and select

Configure and then followed by Configure to Maven Project


2. POM.xml will be generated.
3. Before that, do the following changes in hibernate.cfg.xml
<property
name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property
name="hibernate.connection.url">jdbc:mysql://localhost/TestDB</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">SAIRAM#90</property>

4. In MySQL, Create a database TestDB


5. In that database, create the table User with fields as (user_id, name,
password, email)
6. Insert one or rows into that table.
-----------------------------

You might also like