Skip to content

Commit 7419b41

Browse files
committed
Spring Boot集成Druid
1 parent a090c84 commit 7419b41

17 files changed

+1725
-0
lines changed

spring-boot-demo-29-1/pom.xml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.roncoo.education</groupId>
7+
<artifactId>spring-boot-demo-29-1</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>spring-boot-demo-29-1</name>
12+
<description>Demo project for Spring Boot</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.4.1.RELEASE</version>
18+
<relativePath /> <!-- lookup parent from repository -->
19+
</parent>
20+
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24+
<java.version>1.8</java.version>
25+
</properties>
26+
27+
<dependencies>
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-devtools</artifactId>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.springframework.boot</groupId>
34+
<artifactId>spring-boot-starter-freemarker</artifactId>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.mybatis.spring.boot</groupId>
38+
<artifactId>mybatis-spring-boot-starter</artifactId>
39+
<version>1.1.1</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>com.alibaba</groupId>
43+
<artifactId>druid</artifactId>
44+
<version>1.0.26</version>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.springframework.boot</groupId>
48+
<artifactId>spring-boot-starter-aop</artifactId>
49+
</dependency>
50+
<dependency>
51+
<groupId>mysql</groupId>
52+
<artifactId>mysql-connector-java</artifactId>
53+
<scope>runtime</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-starter-test</artifactId>
58+
<scope>test</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.springframework.boot</groupId>
62+
<artifactId>spring-boot-configuration-processor</artifactId>
63+
<optional>true</optional>
64+
</dependency>
65+
</dependencies>
66+
67+
<build>
68+
<plugins>
69+
<plugin>
70+
<groupId>org.springframework.boot</groupId>
71+
<artifactId>spring-boot-maven-plugin</artifactId>
72+
</plugin>
73+
</plugins>
74+
</build>
75+
76+
77+
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.roncoo.education;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.boot.web.servlet.ServletComponentScan;
6+
import org.springframework.context.annotation.ImportResource;
7+
8+
@ServletComponentScan
9+
@SpringBootApplication
10+
@ImportResource(locations = { "classpath:druid-bean.xml" })
11+
public class SpringBootDemo291Application {
12+
13+
public static void main(String[] args) {
14+
SpringApplication.run(SpringBootDemo291Application.class, args);
15+
}
16+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.roncoo.education.bean;
2+
3+
import java.io.Serializable;
4+
import java.util.Date;
5+
6+
public class RoncooUser implements Serializable {
7+
private Integer id;
8+
9+
private String name;
10+
11+
private Date createTime;
12+
13+
private static final long serialVersionUID = 1L;
14+
15+
public Integer getId() {
16+
return id;
17+
}
18+
19+
public void setId(Integer id) {
20+
this.id = id;
21+
}
22+
23+
public String getName() {
24+
return name;
25+
}
26+
27+
public void setName(String name) {
28+
this.name = name == null ? null : name.trim();
29+
}
30+
31+
public Date getCreateTime() {
32+
return createTime;
33+
}
34+
35+
public void setCreateTime(Date createTime) {
36+
this.createTime = createTime;
37+
}
38+
39+
@Override
40+
public String toString() {
41+
StringBuilder sb = new StringBuilder();
42+
sb.append(getClass().getSimpleName());
43+
sb.append(" [");
44+
sb.append("Hash = ").append(hashCode());
45+
sb.append(", id=").append(id);
46+
sb.append(", name=").append(name);
47+
sb.append(", createTime=").append(createTime);
48+
sb.append(", serialVersionUID=").append(serialVersionUID);
49+
sb.append("]");
50+
return sb.toString();
51+
}
52+
}

0 commit comments

Comments
 (0)