Oracle | 
MySQL | 
|
|---|---|---|
| 可变字符 | varchar2 | 
varchar | 
自增id | 
default SYS_GUID() | CREATE TRIGGER product_before_insert BEFORE INSERT ON product FOR EACH ROW BEGIN IF new.id is NULL THEN SET new.id = UUID(); END IF; END;  | 
字符串转timestamp | 
to_timestamp(‘10-10-2018 10:10:00.000000‘, ‘dd-mm-yyyy hh24:mi:ss.ff‘), | TIMESTAMP(‘2018-12-25 10:18:00.000000‘) | 
搭建完所有子工程后,在Maven父工程处,点击install完成工程构建:

<!-- 超链接: -->
<a th:href="@{/pages/main}">
<!--静态资源: -->
<img th:src="@{/img/center.jpg}">

提取模板片段作为单个页面(不同于JSP不提取也是可以的)
<html xmlns:th="http://www.thymeleaf.org">
<!-- 页面头部 -->
<header class="main-header" th:fragment="header">
    ...
    </header>
</html>
<html xmlns:th="http://www.thymeleaf.org">
    <!-- 导航侧栏 -->
<aside class="main-sidebar" th:fragment="aside">
    ...
    </aside>
</html>
需要使用模板片段的,
th:insert的方法<!-- 页面头部 -->
		<div th:insert="~{pages/header.html::header}"></div>
			<!-- 页面头部 /-->
		<!-- 导航侧栏 -->
		<div th:insert="~{pages/aside.html::aside}"></div>
th:replace和th:include属性插入。
<span th:text="This is prototype text002.">This is prototype text.</span>
<span th:text="${userName}">This is prototype text.</span>

原因:
没有开启Filter(stat、wall)配置。
以下开启方法将会开启失败:
datasource:
    ...
    # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,
    #‘wall‘用于防火墙
    filters: stat,wall
解决办法:
druid:
      filter:
        stat:
          enabled: true
        wall:
          enabled: true
开启后在数据源filter类名中可以查看到stat、wall的类名。(未开启之前是为空的)

具体配置如下:
spring:
  datasource:
   # driver-class-name: com.mysql.cj.jdbc.Driver   #
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      url: jdbc:mysql://localhost:3306/tams_bg?serverTimezone=UTC
      username: root
      password: 123456
      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,
      #‘wall‘用于防火墙
      filter:
        stat:
          enabled: true
        wall:
          enabled: true
      # 配置StatFilter
      web-stat-filter:
        #默认为false,设置为true启动
        enabled: true
        exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
      #配置StatViewServlet
      stat-view-servlet:
        url-pattern: "/druid/*"
        #允许那些ip
        login-username: tom001
        login-password: 1234
        #禁止那些ip
        deny: 192.168.1.102
        #是否可以重置
        reset-enable: true
        #启用
        enabled: true
      #最大等待时间,配置获取连接等待超时,时间单位都是毫秒ms
      max-wait: 60000
      #最大值
      max-active: 20
      #最小值
      min-idle: 5
      #初始化大小
      initial-size: 5
      #配置一个连接在池中最小生存的时间
      min-evictable-idle-time-millis: 60000
      #配置间隔多久才进行一次检测,检测需要关闭的空闲连接
      time-between-eviction-runs-millis: 300000
      test-on-borrow: false
      test-on-return: false
      test-while-idle: true
      pool-prepared-statements: true
      #最大PSCache连接
      max-pool-prepared-statement-per-connection-size: 20
      use-global-data-source-stat: true
      # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
mybatis:
  type-aliases-package: com.justgo.tams_bg_pojo
2020.09 问题总结(Oracle-->MySQL、Maven、JSP-->Thymeleaf、Druid)
原文:https://www.cnblogs.com/l1ng14/p/13754012.html