当前位置: 代码迷 >> Java Web开发 >> spring遇到一个有关问题
  详细解决方案

spring遇到一个有关问题

热度:210   发布时间:2016-04-13 22:30:49.0
spring遇到一个问题
Hibernate: 
    insert 
    into
        machine
        (domain, level, name, use, innerip, ip, language, system, middleware, dbware, cachetype, assembly, mrgsoft, mark) 
    values
        (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
一月 15, 2015 4:02:16 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 1064, SQLState: 42000
一月 15, 2015 4:02:16 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: 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 'use, innerip, ip, language, system, middleware, dbware, cachetype, assembly, mrg' at line 1
一月 15, 2015 4:02:16 下午 org.hibernate.engine.internal.StatisticalLoggingSessionEventListener end
INFO: Session Metrics {
    1089138 nanoseconds spent acquiring 1 JDBC connections;
    0 nanoseconds spent releasing 0 JDBC connections;
    1124443 nanoseconds spent preparing 1 JDBC statements;
    3152875 nanoseconds spent executing 1 JDBC statements;
    0 nanoseconds spent executing 0 JDBC batches;
    0 nanoseconds spent performing 0 L2C puts;
    0 nanoseconds spent performing 0 L2C hits;
    0 nanoseconds spent performing 0 L2C misses;
    0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
    0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
}

------解决思路----------------------
因为生成的sql语句中含有关键字use  所以报错。你把你的表use字段改个名字应该就OK了
  相关解决方案