【发布时间】:2017-05-13 11:28:21
【问题描述】:
类实体
@Entity
@Table
public class Camera {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private String place;
private String address;
public Long getId() {
return id;
}
public String getName() {
return name;
}
public String getPlace() {
return place;
}
public void setId(Long id) {
this.id = id;
}
//Constructors, getters and setters are not shown here
}
application.properties 配置文件
spring.datasource.url= jdbc:mysql://localhost:3306/springbootdb
spring.datasource.username=root
spring.datasource.password=
server.port=9000
我有这个错误
Exception in thread "Thread-3" org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: La table 'springbootdb.camera' n'existe pas
我必须在数据库中手动创建表才能工作:(知道吗?是配置文件有问题吗?谢谢你的帮助:)
【问题讨论】:
标签: mysql spring-data