首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >SpringBoot Postgresql驱动程序问题

SpringBoot Postgresql驱动程序问题
EN

Stack Overflow用户
提问于 2019-03-03 08:35:19
回答 1查看 673关注 0票数 0

我使用SpringBoot和Intellij。我相信我拥有所需的所有依赖关系。尽管如此,我仍然不断地得到PostgreSQL驱动程序没有发现错误。下面是Gradle文件中的依赖项。

代码语言:javascript
运行
复制
dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-rest'
    implementation 'org.springframework.boot:spring-boot-starter-jdbc'
    implementation 'org.springframework.boot:spring-boot-starter-jersey'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    runtimeOnly 'org.springframework.boot:spring-boot-devtools'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-03 08:42:36

还添加以下依赖项:

代码语言:javascript
运行
复制
compile group: 'org.postgresql', name: 'postgresql', version: '42.1.1'

在gradle.build文件中包含依赖项之后,还在Application.properties文件中包含以下行,以通知应用程序PostgreSQL服务器在哪里,以及访问数据库的凭据是什么

spring.datasource.url= jdbc:postgresql://localhost:5432/dbname spring.datasource.username=postgres spring.datasource.password=xxxxxxxx Spring.jpa.Hibernate.ddl-auto=create

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54966987

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档