com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.ac_flight' doesn
作者:互联网
1....springBoot运行报错:
ycom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'flight0_.arrival_city' in 'field list'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_201]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_201]
Unknown column 'flight0_.arrival_city' in 'field list':
说明:springBoot工程访问,获取界面数据时,报错!!!
数据库存在不能识别的列,也就是访问的表不存在这个字段,
那么针对这个问题,去调节一下entity类
1 @Id 2 @GeneratedValue(strategy = GenerationType.IDENTITY) //自增设置 3 /** 4 * @Column 注解(表的字段) 必须加上 ,不然 test 会报错 5 * 报错信息 : 数据库表 不存在 某个字段 6 * com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'flight0_.arrival_city' in 'field list' 7 */ 8 @Column(name="flight_id") 9 private Integer id; 10 @Column(name="flight_no") 11 private String flightNo; 12 @Column(name="departure_city") 13 private String departureCity; 14 @Column(name="departure_time") 15 private Date departureTime; 16 @Column(name="arrival_time") 17 private Date arrivalTime; 18 @Column(name="arrival_city") 19 private String arrivalCity;
标签:arrival,city,ac,jdbc,jdbc4,name,Column,private,报错 来源: https://www.cnblogs.com/wangshichang/p/11396234.html