Using MySql DataBase in Hibernate



Create a database with MySql or PostgreSQL or anything you like. Call it ?firsthibernate?.

Using PostgreSql use the following script to create your table:

CREATE TABLE “public”.”honey” (
id SERIAL,
name text,
taste text,
PRIMARY KEY(id)
);

Using MySql use the following script:

CREATE TABLE `honey` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(250) default NULL,
`taste` varchar(250) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM CHARSET=latin1

MySQL Version:








Share with SociBook.com

Random Posts

Post a Comment