如何修复Spring Boot + SQL Server 2019异常?

时间:2019-12-14 22:31:15

标签: sql sql-server spring spring-boot

我尝试将SQL Server 2019用于Spring应用程序。

我的道具:

spring.datasource.url=jdbc:sqlserver://localhost;databaseName=advertiser
spring.datasource.username=sa
spring.datasource.password=mypass
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
spring.jpa.hibernate.ddl-auto = create-drop

我遇到了例外情况:

org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "alter table advertisement_post drop constraint FKbljmwnxut8v6ak6nedax933ms" via JDBC Statement
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot find the object "advertisement_post" because it does not exist or you do not have permissions.

尽管创建了例外表,但已插入数据,应用程序未停止。因此,据我了解,这是RunntimeException。但是,为什么我要得到它? 如何清除此异常?

0 个答案:

没有答案