刚才打Java代码出现了错误,百度了好多也没有解决掉,是更新数据库的错误,很急,求大神指教!!!

try {Jbuilder builder = new Jbuilder();conn = builder.Jbuilder();stmt2=conn.createStatement();
//          String sql3="select * from news";
//          rs3 = stmt2.executeQuery(sql3);String sql = "update news SET mima = ?  where zhanghao = ?";   //SQL语句ps = conn.prepareStatement(sql);ps.setString(1, T2.getText());                      这两个文本框中获取的文本内容ps.setString(2, T1.getText());ps.executeUpdate(sql);         //将sql语句上传至数据库执行         int res=ps.executeUpdate();if(res>0){System.out.println("更新数据成功");}ps.close();}catch(SQLException e1) {e1.printStackTrace();}

错误提示:
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 ‘? where zhanghao = ?’ at line 1

求大神!!!

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException相关推荐

  1. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'rtjhyt' in 'field list'

    今天向数据库中插入语句遇到了这样的异常: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'rtjh ...

  2. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test'

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test' com.mysql.jdbc.ex ...

  3. Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty

    1 错误描写叙述 at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(Invocable ...

  4. Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 't.statis_date'

    1.错误原因 [ERROR:]2015-04-18 13:20:31,883 [异常拦截] com.skycloud.oa.exception.ExceptionHandler org.hiberna ...

  5. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GR

    项目场景: sql报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list ...

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

    解决com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 1. 报错内容 com.mysql.jdbc.exceptions.jdbc4 ...

  7. mybatis-plus调用自身的 selectById 方法报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You hav

    1.报错信息: 1.1早上的报错信息:这个是我下午模拟上午的错误(已经通过1.2里面的错误信息找到错误原因了),让他产生错误信息,但是这个和上午产生的错误信息不一样了,上午的我不知道错误在哪,这个就知 ...

  8. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:异常问题解析!

    首先遇到这样的问题,肯定是你的sql写错了,应该不用怀疑,虽然我把sql代码抽取出来在sql 单独运行了一遍,没有报错,但是还是sql语法的错误,下面先上错误的代码 <select id=&qu ...

  9. 已解决idea连接数据库异常:Exception in thread “main“ com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:

    Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You ...

最新文章

  1. opencv中vc14和vc15的区别?
  2. 并发事务正确性的准则 可串行化_从0到1理解数据库事务(上):并发问题与隔离级别...
  3. mysql运行状态监控研究内容_如何监控mysql主从的运行状态shell脚本实例介绍
  4. 小艾k个人发卡网PHP源码
  5. php 周末 培训,济南php周末培训班
  6. iphone7p配置参数详情_华为mate40标准版参数配置-参数详情
  7. JUCE学习笔记04-LookAndFeel类自定义Slider颜色
  8. 《未来简史(下)》万维钢解读
  9. 提莫攻击 findPoisonedDuration
  10. 超详细!Jmeter性能测试(一)
  11. 湖大计算机学院博士后李晓灿,李蕊-湖大信息科学与工程学院
  12. GIC检测中断的流程
  13. LCD12864液晶显示
  14. SpringBoot中注入RedisTemplate实例异常解决
  15. 使用MSP430F5529的ADC测量,并用OLED显示传感器输出的模拟量
  16. IEC 61850 Compatible OpenPLC for Cyber Attack Case Studies on Smart Substation Systems
  17. markdown中编辑复杂表格
  18. 【2018年总】——感谢遇见,感谢拥有,感谢失去
  19. maven私服上传jar包
  20. unity2D物体朝向并靠近鼠标位置,击退效果

热门文章

  1. php fileinfo 作用,PHP Fileinfo函数 详解
  2. 编写程序计算两个矩阵之和。
  3. 索骥馆-编程语言之《算法引论-一种创造性方法》扫描版[PDF]
  4. openbmc-web3:添加语言
  5. Booth(布斯)算法——补码乘法运算过程
  6. [Windows]删除我的电脑WPS网盘等盘符
  7. android ios动态模糊效果,iOS实现模糊效果的几种方法
  8. Python 常用的标准库以及第三方库
  9. 从硬盘启动计算机就卡住了,电脑插入U盘启动盘就卡住该怎么解决
  10. idea 使用debug模式自动编译的设置