-2

公共无效字体属性(){

 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
4

1 回答 1

1

right并且left保留的 MySQL 关键字。更改这些列的名称。

于 2013-07-01T06:57:06.687 回答