zoukankan      html  css  js  c++  java
  • Intellij 集成mybatis 查询的时候错误

    报告 sql 语法错误,

    把生成的代码,贴到sqlyog里运行,也提升错误

    原因是 sql里用了sql的关键字,如lock。

        from tbl_admin
        where id = 1' at line 3
    ### The error may exist in file [D:OneDriveprojectactiviti	argetclassesmapperAdminMapper.xml]
    ### The error may involve cn.taotao.dao.AdminMapper.selectByPrimaryKey-Inline
    ### The error occurred while setting parameters
    ### SQL: select            id, username, password, email, lock, birth         from tbl_admin     where id = ?
    ### Cause: java.sql.SQLSyntaxErrorException: 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 'lock, birth
       
        from tbl_admin
        where id = 1' at line 3
    ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 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 'lock, birth

     错误中已经提到 near ‘ lock ,birth, from tbl_admin  where id =1 '.....

    这里的错误,原因是 lock 是关键字,改为其他即可。弄了半个下午

  • 相关阅读:
    html5-本地数据库的操作
    html5_storage存取实例
    html5-表单常见操作
    js操作注意事项
    php扩展地址下载
    php serialize序列化对象或者数组
    php_memcahed 使用方法
    php_memcahed telnet远程操作方法
    php_memcahed 安装
    Liunx centos 系统 修改hostname
  • 原文地址:https://www.cnblogs.com/sdgtxuyong/p/15227103.html
Copyright © 2011-2022 走看看