Home > Back-end >  Using springboot link database can't return data
Using springboot link database can't return data

Time:01-02

Beginners spring recently met a problem, the boot when I link to the mysql database is return not to come out, run directly in the browser to access is 0, null, 0 then use dubug mode is direct error
Org. Springframework. Beans. Factory. UnsatisfiedDependencyException: Error creating bean with the name 'jdbcConverter defined in the class path resource [org/springframework/boot/autoconfigure/data/JDBC/JdbcRepositoriesAutoConfiguration $SpringBootJdbcConfiguration class] : Unsatisfied dependency expressed through method' jdbcConverter parameter 4; Nested exception is org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name 'jdbcDialect defined in the class path resource [org/springframework/boot/

Database link of what should be no problem, I use the method of the servlet can return data to the page, just don't know where spring boot here I made a mistake, below is the code, and trouble, I see, thank you,

@ RestController

Public class ProductHandler {
The @autowired
Private ProductRepository ProductRepository;

@ GetMapping ("/product/the.findall ")
Private List The.findall () {
Return productRepository. The.findall ();
}


}


@ Component
Public class ProductRepository implements prodcutRepository {

The @autowired
Private JdbcTemplate template;

@ Override
Public List The.findall () {

//List List=template. The query (" selectPRODUCT * from ", new BeanPropertyRowMapper<> (the Product class));
int i=0;
Return the template. The query (" select * from the PRODUCT ", the new BeanPropertyRowMapper<> (the Product class));
}

@ Override
Public void findByid (int id) {

}

@ Override
Public void save Product (Product) {

}

@ Override
Public void update (Product Product) {

}

@ Override
Public void deletebyId (int id) {

}
}

@ Data
Public class Product {

Private long proid.

private String desc;

Private int inhand.
}
Spring. The datasource. Url=JDBC: mysql://localhost: 3306/Seneca
Spring. The datasource. The username=root
Spring. The datasource. Password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

CodePudding user response:

  • Related