From 46e5d9c68d78e322d20b671cda8fc4240d8cabd1 Mon Sep 17 00:00:00 2001 From: Romesum Date: Wed, 29 Apr 2020 17:59:42 +0800 Subject: [PATCH] =?UTF-8?q?[fix][M]:=E4=BF=AE=E6=94=B9springboot=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- java/pom.xml | 38 +++++++++---------- .../java/com/hzu/bookingsystem/VO/test.java | 0 .../src/main/resources/application.properties | 9 +---- java/src/main/resources/application.yml | 26 +++++++++++++ 4 files changed, 46 insertions(+), 27 deletions(-) delete mode 100644 java/src/main/java/com/hzu/bookingsystem/VO/test.java create mode 100644 java/src/main/resources/application.yml diff --git a/java/pom.xml b/java/pom.xml index 3663742..23fd09a 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -1,11 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot spring-boot-starter-parent - 2.2.6.RELEASE + 2.1.5.RELEASE com.hzu @@ -21,20 +21,30 @@ org.springframework.boot - spring-boot-starter-security + spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter-jdbc + + com.alibaba + druid + 1.1.4 + org.springframework.boot spring-boot-starter-web - org.mybatis.spring.boot - mybatis-spring-boot-starter - 2.1.2 + mysql + mysql-connector-java + runtime + + + org.springframework.boot + spring-boot-starter-test + test @@ -43,19 +53,9 @@ true - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - org.springframework.security - spring-security-test + org.junit.jupiter + junit-jupiter + RELEASE test diff --git a/java/src/main/java/com/hzu/bookingsystem/VO/test.java b/java/src/main/java/com/hzu/bookingsystem/VO/test.java deleted file mode 100644 index e69de29..0000000 diff --git a/java/src/main/resources/application.properties b/java/src/main/resources/application.properties index 0aaf2ac..9e0cb59 100644 --- a/java/src/main/resources/application.properties +++ b/java/src/main/resources/application.properties @@ -2,11 +2,4 @@ server.tomcat.uri-encoding=UTF-8 server.servlet.context-path=/lb server.port=8080 -### mysql连接信息 -spring.datasource.url=jdbc:mysql://127.0.0.1:3306/lab_booking?characterEncoding=utf-8&serverTimezone=UTC -### 用户名 -spring.datasource.username=root -### 密码 -spring.datasource.password=123456 -### 驱动 -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver \ No newline at end of file +spring.jpa.show-sql=true diff --git a/java/src/main/resources/application.yml b/java/src/main/resources/application.yml new file mode 100644 index 0000000..62da168 --- /dev/null +++ b/java/src/main/resources/application.yml @@ -0,0 +1,26 @@ +spring: + datasource: + username: root + password: 123456 + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/lab_booking?characterEncoding=utf-8&serverTimezone=UTC + type: com.alibaba.druid.pool.DruidDataSource + + initialSize: 5 + minIdle: 5 + maxActive: 20 + maxWait: 60000 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + + filters: stat,wall,log4j + maxPoolPreparedStatementPerConnectionSize: 20 + useGlobalDataourceStat: true + connectionProperties: druid.stat.mergeSql=true:druid.stat.slowSqlMillis=500 + +