File tree Expand file tree Collapse file tree 4 files changed +5
-37
lines changed
java/tk/mybatis/springboot Expand file tree Collapse file tree 4 files changed +5
-37
lines changed Original file line number Diff line number Diff line change 15
15
@ EnableWebMvc
16
16
@ SpringBootApplication
17
17
public class Application extends WebMvcConfigurerAdapter {
18
-
18
+
19
19
public static void main (String [] args ) {
20
20
SpringApplication .run (Application .class , args );
21
21
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 29
29
import org .apache .ibatis .session .SqlSessionFactory ;
30
30
import org .mybatis .spring .SqlSessionFactoryBean ;
31
31
import org .springframework .beans .factory .annotation .Autowired ;
32
- import org .springframework .boot .context .properties .ConfigurationProperties ;
33
32
import org .springframework .context .annotation .Bean ;
34
33
import org .springframework .context .annotation .Configuration ;
35
34
import org .springframework .core .io .support .PathMatchingResourcePatternResolver ;
36
35
import org .springframework .core .io .support .ResourcePatternResolver ;
37
- import tk .mybatis .mapper .entity .Config ;
38
36
39
37
import javax .sql .DataSource ;
40
38
import java .io .IOException ;
@@ -58,12 +56,6 @@ public class MyBatisConfig {
58
56
@ Autowired
59
57
SqlSessionFactory sqlSessionFactory ;
60
58
61
- @ Bean
62
- @ ConfigurationProperties (prefix = "mybatis.mapper" )
63
- public Config mapperConfig () {
64
- return new Config ();
65
- }
66
-
67
59
@ Bean (name = "sqlSessionFactory" )
68
60
public SqlSessionFactoryBean sqlSessionFactoryBean () {
69
61
SqlSessionFactoryBean bean = new SqlSessionFactoryBean ();
Original file line number Diff line number Diff line change @@ -7,12 +7,14 @@ logging:
7
7
tk.mybatis : DEBUG
8
8
9
9
spring :
10
- druid :
10
+ datasource :
11
11
name : test
12
12
url : jdbc:mysql://192.168.16.137:3306/test
13
13
username : root
14
14
password :
15
- driverClassName : com.mysql.jdbc.Driver
15
+ # 使用druid数据源
16
+ type : com.alibaba.druid.pool.DruidDataSource
17
+ driver-class-name : com.mysql.jdbc.Driver
16
18
filters : stat
17
19
maxActive : 20
18
20
initialSize : 1
You can’t perform that action at this time.
0 commit comments