After downloading, import the project to MyEclipse, and then modify the database connection parameters to test. I'm using the MySQL database. JSP is because the Hibernate can match various frameworks, so in the code I have tried to separate the page and the background directly variable coupling.
Some of the code shows:
Related SQL:
CREATE TABLE ' user ' (
' id ' int () not NULL,
' username ' varchar ' is not NULL,
' password ' varchar not N ull,
' age ' int,
PRIMARY KEY (' id ')
) Engine=myisam DEFAULT CHARSET=GBK;
--JDBC Driver Name:com.mysql.jdbc.Driver
--jdbc Driver url:jdbc:mysql://hostname/dbname?
USEUNICODE=TRUE&CHARACTERENCODING=GBK
INSERT INTO user values (1, ' Chinese ', ' Beansoft ', 1);
Insert into user values (2, ' beansoft ', ' Beansoft ', 2);
Insert into user values (3, ' John ', ' Beansoft ', 3);
Insert into user values (4, ' Dick ', ' Beansoft ', 4);
Insert into user values (5, ' Harry ', ' Beansoft ', 5);
Insert into user values (6, ' Ma Liu ', ' Beansoft ', 6);
Insert into user values (7, ' Black Seven ', ' Beansoft ', 7);
Insert into user values (8, ' Laba ', ' Beansoft ', 8);
Insert into user values (9, ' Land Nine ', ' Beansoft ', 9);
Insert into user values (10, ' Mao 18 ', ' Beansoft ', 10);