I have a VM running an MsSQL database. I was previously using an Oracle database. My app injects some sample data on startup and I get this error:
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'springbootdb.users'.
data.sql
INSERT INTO "springbootdb"."users" (USER_ID, EMAIL, FIRST_NAME, INITIAL_NAME, LAST_NAME, PASSWORD, ROLE, ENABLED, CURRENT_STATUS, POSITION_TITLE) VALUES ('1', 'asdf@asdf.com', 'asdf', 'asdf', 'asdf', '12345', 0, 1, 'In Office', 'Advanced Developer');
INSERT INTO "springbootdb"."users" (USER_ID, EMAIL, FIRST_NAME, INITIAL_NAME, LAST_NAME, PASSWORD, ROLE, ENABLED, CURRENT_STATUS, POSITION_TITLE) VALUES ('2', 'asdf@asdf.com', 'asdf', 'asdf', 'asdf', '12345', 0, 1, 'In Office', 'Associate Developer');
INSERT INTO "springbootdb"."users" (USER_ID, EMAIL, FIRST_NAME, INITIAL_NAME, LAST_NAME, PASSWORD, ROLE, ENABLED, CURRENT_STATUS, POSITION_TITLE) VALUES ('3', 'asdf@asdf.com', 'asdf', 'asdf', 'adsf', '12345', 1, 1, 'In Office', 'Line Manager');
application.properties
# MsSQL Connection
spring.datasource.url=jdbc:sqlserver://11.11.111.1:1433;database=springbootdb;
spring.datasource.username=admin
spring.datasource.password=123!
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.jpa.show-sql=true
spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
spring.jpa.hibernate.ddl-auto=create-drop
I have tested that there is indeed a connection. I can also access the database from MSQLSMS from an sql account, as shown in the picture below:
Why am I getting this error?