Skip to content

Hyzhou/DatabaseDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Database Demo

How to run

  1. 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
  1. 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

Interview

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.

About

The demo of using database in java language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages