1. Spring boot 连接 oracle 数据库;
Build.gradle 文件中添加:
repositories {
mavenLocal()
maven { url 'http://repo.spring.io/libs-release' }
mavenCentral()
}
dependencies 中添加
compile ('com.oracle:ojdbc6:11.2.0.3')
版本号不要变,另外的版本不在开源协议里,jar 包不能自动下载。
Applicaon.properes 中的配置:
##这个链接配置能正常使用
#spring.jpa.database=oracle
#spring.datasource.primary.driver-class-
name:oracle.jdbc.driver.OracleDriver
#spring.datasource.primary.url:jdbc:oracle:thin:@localhost:1
521:SMARTMES
#spring.datasource.primary.username:system
#spring.datasource.primary.password:123456
#spring.jpa.hibernate.ddl-auto=create
只需修改 SMARTMES 和用户名/密码,可用 pl/sql 先测试一下数据库能不能正常使用。
评论2
最新资源