- You will start you mysql and change the properties for your data source.
database.url=jdbc:mysql://localhost:3306/hyzhou
database.username=root
database.password=root
- Create a table
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`age` int(11) DEFAULT NULL,
`birth` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
api: The project public interface and database model.
jdbc: Origin jdbc using, we will connect to the database and close the connection by myself.
jdbc-template: By using the SimpleJdbcTemplate
. we will only focus on the sql.
jdbc-dao-support: We will only extend the SimpleJdbcDaoSupport
, do not need to declare the template.
ibatis: Decoupling the sql form the java code.
ibatis-spring: Using ibatis with spring.