Mybatis与SQL连接配置

MySQL

MySQL依赖

        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
            2.2.2
        

        
            mysql
            mysql-connector-java
            runtime
        

application.properties配置

spring.datasource.url=jdbc:mysql://IP地址/数据库?serverTimeZone=GMT%2B8&Character=utf8
spring.datasource.username=账号
spring.datasource.password=密码

mybatis.mapper-locations=classpath:/mapper/*.xml

Oracle

Oracle依赖

        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
            2.2.2
        

        
            com.oracle.database.jdbc
            ojdbc8
            12.2.0.1
        

application.peoperties

spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.url=jdbc:oracle:thin:@IP地址
spring.datasource.username=账号
spring.datasource.password=密码

你可能感兴趣的:(springboot)