Reputation: 191
I try to connect my gradle Spring Boot Application to a running SQL Server Express installation.
My configuration is
spring.datasource.url=jdbc:sqlserver://localhost;InstanceName=SQLEXPRESS;databaseName=testDB;integratedsecurity=true
spring.datasource.username=SpringBootUser
spring.datasource.password=testPassword123
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.jpa.show-sql=true
spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServerDialect
spring.jpa.hibernate.ddl-auto = validate
The build.grade has those dependencies:
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.microsoft.sqlserver:mssql-jdbc'
annotationProcessor 'org.projectlombok:lombok'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
}
But all i get are those messages:
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
Upvotes: 1
Views: 2800
Reputation: 191
After i downloaded a sqljdbc_auth.dll and put it into the PATH the Application ran.
Upvotes: 0
Reputation: 97
Make sure you have an application.properties in your classpath. it seems your application couldn't load your configuration file.
Upvotes: 1