I am assuming that you have running instance of MySQL Database and you know how to work with the MySQL database. To access the database you should have valid user name and password.
Let's now start by creating the database for our struts- hibernate integration tutorial. Our application is very very simple and it searches for the keywords typed by user in the table. The database will contain one table 'tutorials' for holding the tutorials links and descriptions. Here is the complete sql script for setting up the database.
The above table holds the short description, long description and url of the tutorials. The field 'id' is the unique identifier for records in the articles table.
Here are the details of the each of the fields in the table:
id: Unique key for the table
shortdesc: This fields stores the short description of the tutorial.
longdesc: This field stores the full description about the tutorial
pageurl: This field is stores the url of the tutorial
Run the following query to populate table with tutorials data:
|INSERT INTO `tutorials` VALUES (1, 'JSP Tutorials, Hibernate and struts Tutorials', 'This site contains many quality Java, JSP Tutorials, Hibernate Tutorials, Struts Tutorials, JSF Tutorials, RMI, MySQL Tutorials, Spring Tutorials, source codes and links to other java resources. We have large number of links to the tutorials on java', 'http://roseindia.net/');
In the above steps we have setup our database. In the next section we will write java stuffs to integrate struts and hibernate.
Posted on: January 30, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles