我制作了一个简单的应用程序以连接到MySQL数据库,但出现此错误:
org.springframework.jdbc.core.JdbcTemplate
在我的配置中(com.kubamadry.dao.MySqlStudentDao):
*****************************
APPLICATION FAILED TO START
*****************************
Description:
Field jdbcTemplate in com.kubamadry.dao.MySqlStudentDao required a bean of type 'org.springframework.jdbc.core.JdbcTemplate' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.jdbc.core.JdbcTemplate' in your configuration.
Disconnected from the target VM, address: '127.0.0.1:49838', transport: 'socket'
Process finished with exit code 1
Run Code Online (Sandbox Code Playgroud)
项目结构:
班级
主要
package com.kubamadry;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Main {
public static void main(String args[]) {
SpringApplication.run(Main.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
学生
package …Run Code Online (Sandbox Code Playgroud)