Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Jsf Myfacesspring Setup MySQL Database

 
 

Share on Google+Share on Google+

Setup MySQL Database

Advertisement
In this section we will create database and table into MySQL database.

Setup MySQL Database

        

In this section we will create database and table into MySQL database. Table created here will be used in sample application.

Downloading and Installing MySQL

You can download MySQL from mysql.org. Read more on downloading and installing mysql at http://www.roseindia.net/mysql/mysql5/Installing-MySQL-on-Windows.shtml

Creating Database :

You can create mysql database by issuing the following command:

>mysql>create database jsf_hibenate;

Creating Table :

To create table in this database you would have to first select the database by use statement.

mysql>use jsf_hibenate

Now, you can create table using the following command :

mysql>create table users ( 
userId int(11) NOT NULL auto_increment, 
userName varchar(20) default NULL, 
userPassword varchar(11) default NULL, 
userEmail varchar(30) default NULL, 
userAddress varchar(30) default NULL, 
PRIMARY KEY (userId) 
) ;

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: May 22, 2009

Related Tutorials

Discuss: Setup MySQL Database   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com