Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException解决

关于报Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException异常解决方法

 

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException解决

 

 


这个问题在本地是没有的,部署到测试环境就出现了这个问题。


经过反复思考发现是mysql数据库的type字段是关键字

修改之前:

              select type,equipment_name,obj_id from eqment_basic group by type,equipment_name order by type

修改之后:

            select eb.type,eb.equipment_name,eb.obj_id from eqment_basic eb group by eb.type,eb.equipment_name order by eb.type