完整报错信息:

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 '?' at line 1

踩坑经历:

在有道词典翻译后,“你的SQL语法有错误;检查手册对应的MySQL服务器版本的正确语法附近'?'在第1行”。这句话的意思是在?附近的SQL语句有错误。当我去看整个SQL语句时,发现SQL语句并没有写错。然后我就觉得应该是PreparedStatement这个类的预编译或编译的方法那出错了,于是我去看了.prepareStatement()和.executeQuery()方法,发现.executeQuery()传入了sql语句,没想到自己还遇到了这种低级的错误。。。

解决方法:

将ppstm.executeQuery(sql);中的sql去掉,改成ppstm.executeQuery();

关于...corresponds to your MySQL server version for the right syntax to use near '?' at line 1的解决办法的更多相关文章

  1. [Err] 1064 - 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 ''<h1 style="text-align: center;">php

    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...

  2. 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 'type=InnoDB' at line 7

    问题: 使用hibernate4.1.1,数据库使用mysql5.1.30,使用hibernate自动生成数据库表时,hibernate方言使用org.hibernate.dialect.MySQLI ...

  3. C# Mysql 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 ????

    有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲. 错误提示: You have an error in your SQL syntax; check the man ...

  4. 遇到的check the manual that corresponds to your MySQL server version for the right syntax错误

    遇到的check the manual that corresponds to your MySQL server version for the right syntax错误. 结果发现是SQL关键 ...

  5. MySql 执行语句错误 Err] 1064 - 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

    关于用Power Designer 生成sql文件出现 错误  [Err] 1064 - You have an error in your SQL syntax; check the manual ...

  6. MySQL遇到check the manual that corresponds to your MySQL server version for the right syntax错误

    用MySQL新建了一个Order表,插入了一条数据.总是显示 You have an error in your SQL syntax; check the manual thatcorrespond ...

  7. 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 '

    mysql中如果字段使用了关键字,在插入和更新时会提示 You have an error in your SQL syntax; check the manual that corresponds ...

  8. MySQL check the manual that corresponds to your MySQL server version for the right syntax错误

    地化GO的时候一直遇到一个错误就是check the manual that corresponds to your MySQL server version for the right syntax ...

  9. 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 ...

    下面是我update数据库时打印出来的异常: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSynt ...

随机推荐

  1. Java框架-MyBatis三剑客之MyBatis Generator(mybatis-generator MBG插件)详解

    生成器设计思路: 连接数据库 -> 获取表结构 -> 生成文件 1 下载与安装 官网文档入口 最方便的 maven 插件使用方式 贴至pom 文件 2 新建配置文件 填充配置信息(官网示例 ...

  2. Mongodb 3.2.8: 集群环境搭建

    简介 MongoDB是一种面向文档的数据库管理系统,由C++撰写而成,以此来解决应用程序开发社区中的大量现实问题.2007年10月,MongoDB由10gen团队所发展.2009年2月首度推出. ## ...

  3. rabbitmq在kubernetes中持久化集群部署

    背景 Javashop电商系统的消息总线使用的事rabbitmq,在订单创建.静态页生成.索引生成等等业务中大量采用异步消息系统,这个对于mq高可用的要求有两个重要的考量: 1.集群化 2.可扩容 3 ...

  4. [Effective Java 读书笔记] 第三章 对所有对象都通用的方法 第八 ---- 九条

    这一章主要讲解Object类中的方法, Object类是所有类的父类,所以它的方法也称得上是所有对象都通用的方法 第八条 覆盖equals时需要遵守的约定 Object中的equals实现,就是直接对 ...

  5. bin utilities related

    objdump -S,如果有源程序的话,将源程序与汇编代码混合在一起. 使用该选项时,输入的目标文件需要有调试信息,即用gcc -g生成的目标文件才可以,因为,调试信息中采用源程序信息. objcop ...

  6. k8s系列----一个简单的例子

    本实验来自k8s权威指南 解决访问demo出错,关键是靠https://www.cnblogs.com/neutronman/p/8047547.html此链接下面的某个大神的评论 主要yaml文件 ...

  7. U盘模式无法引导进入pe系统

        有些笔记本.一体机 特别是win8.win10系统维护时需要 通过u盘进入pe系统,就是进不去,需要到bios中更改一下设置.            1.首先我们将已经使用u启动u盘启动盘制作 ...

  8. 为什么Linux 实例执行 df 和 du 查看磁盘时结果不一致

    问题现象 执行 df -h 查看 ECS Linux 实例文件系统使用率,可以看到 /dev/xvdb1 磁盘占用了约27G,挂载目录为 /opt . 进入到 /opt 目录执行 du -sh ,显示 ...

  9. 基于 H5 Canvas 实现楼宇新风系统

    前言 现如今,新型冠状病毒疫情牵动着每一个人的神经,每天起床后的第一件事就是打开疫情地图,看看最新的疫情数据. (http://www.hightopo.com/demo/coronavirus/) ...

  10. 多版本python创建虚拟环境

    不表示默认的python使用 mkvirtualenv -p c:\python27\python.exe  test1,即 mkvirtualenv -p  要安装的版本的python.exe路径  ...