问题如下:

Parameter 0 of constructor in org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration required a bean of type 'javax.sql.DataSource' that could not be found.
- Bean method 'dataSource' not loaded because @ConditionalOnClass did not find required class 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType'
- Bean method 'dataSource' not loaded because @ConditionalOnClass did not find required class 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType'


Action:

Consider revisiting the conditions above or defining a bean of type 'javax.sql.DataSource' in your configuration.

启动类如下配置:

Springboot---springboot sqlserver连接总是提示sql问题,解决办法_mybatis

问题就出现在这里面,因为configuration它默认去访问你的配置,你没有配置好或者有一些疏忽都会报异常,所以,解决办法是去掉@configuration标注,改为如下即可:

Springboot---springboot sqlserver连接总是提示sql问题,解决办法_jdbc_02

具体原因没有来的及时深究,项目催时间,先干着再说。