Spring Boot datasource

22 views
Skip to first unread message

Michael MacEachran

unread,
Apr 20, 2019, 9:01:21 PM4/20/19
to cas-...@apereo.org
Beginner question:

  I need to autowire a DataSource for one of my AuthenticationHandlers.  In my cas.properties I have the standard spring datasource properties that I have used many times:

spring.datasource.driver-class-name=javax.sql.DataSource
spring.datasource.url=jdbc:mysql://localhost:3306/MSO
spring.datasource.username=michael
spring.datasource.password=
spring.datasource.autocommit=true

But I am getting an error at bean creation:

Failed to bind properties under 'spring.datasource' to javax.sql.DataSource>

I can only assume that I put the properties in the wrong place?  Where should my datasourcce properties (and eventually HikariCP properties)  go?

Michael

Andrey Seledkov

unread,
Apr 22, 2019, 9:53:21 AM4/22/19
to CAS Community
Hello Michael

It is my application.properties file and it works

cas.authn.jdbc.query[0].sql=SELECT password FROM users WHERE username=?
cas.authn.jdbc.query[0].url=jdbc:mysql://localhost:3306/test
cas.authn.jdbc.query[0].dialect=org.hibernate.dialect.MySQL8Dialect
cas.authn.jdbc.query[0].user=
cas.authn.jdbc.query[0].password=
cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver
cas.authn.jdbc.query[0].fieldPassword=password
cas.authn.jdbc.query[0].passwordEncoder.type=NONE
cas.authn.jdbc.query[0].passwordEncoder.characterEncoding=UTF-8




воскресенье, 21 апреля 2019 г., 4:01:21 UTC+3 пользователь Michael MacEachran написал:
Reply all
Reply to author
Forward
0 new messages