【问题标题】:org.hibernate.exception.SQLGrammarException: could not execute statement,org.hibernate.exception.SQLGrammarException:无法执行语句,
【发布时间】:2013-06-28 04:16:24
【问题描述】:

public void fontProperties(){

 Fonts fl=new Fonts();

会话 sess=HibernateUtil.getSessionFactory().openSession();

    Transaction tx1=sess.beginTransaction();        

    fl.setFont("arial");
    fl.setSize("arial1");
    fl.setStyle("arial2");
    fl.setLineheight("arial3");
    fl.setColor("arial4");
    fl.setBgcolor("arial5");
    fl.setBgimage("arial6");
    fl.setWidth("arial7");
    fl.setHeight("arial8");
    fl.setTop("arial9");
    fl.setRight("arial10");
    fl.setBottom("arial11");
    fl.setLeft("arial12");

    sess.save(fl);
         tx1.commit();
    sess.close();

例外:

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'right, bottom, left, sid) values ('arial', 'arial1', 'arial2', 'arial3', 'arial4' at line 1

【问题讨论】:

  • 您必须花更多时间编辑您的问题。还请告诉我们您为解决该错误所做的尝试。

标签: mysql hibernate


【解决方案1】:

rightleftreserved MySQL keywords。更改这些列的名称。

【讨论】:

    猜你喜欢
    • 2014-01-01
    • 1970-01-01
    • 2022-11-09
    • 2016-10-15
    • 2017-04-30
    • 2021-08-10
    • 1970-01-01
    • 2023-03-03
    • 2011-10-17
    相关资源
    最近更新 更多