-2

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
4

1 に答える 1

1

rightおよびleft予約済みの MySQL キーワードです。これらの列の名前を変更します。

于 2013-07-01T06:57:06.687 に答える