zoukankan      html  css  js  c++  java
  • com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.ac_flight' doesn't exist

    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;

     

  • 相关阅读:
    (转)TweenMax动画库学习(三)
    (转)TweenMax动画库学习(二)
    (转)TweenMax动画库学习(一)
    深入剖析Java中的装箱与拆箱(转)
    Spring MVC 和 Spring 总结(转)
    react native for android(ajax)
    React Native HelloWorld
    C# JMAIL发送邮件
    C# 接收邮件
    Spring Mvc Mybatis(初次学习)
  • 原文地址:https://www.cnblogs.com/wangshichang/p/11396234.html
Copyright © 2011-2022 走看看