com.mysql.jdbc.exceptions.MySQLSyntaxErrorException
刚才打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相关推荐
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'rtjhyt' in 'field list'
今天向数据库中插入语句遇到了这样的异常: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'rtjh ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test'
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test' com.mysql.jdbc.ex ...
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty
1 错误描写叙述 at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(Invocable ...
- 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 ...
- 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 ...
- 解决com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
解决com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 1. 报错内容 com.mysql.jdbc.exceptions.jdbc4 ...
- mybatis-plus调用自身的 selectById 方法报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You hav
1.报错信息: 1.1早上的报错信息:这个是我下午模拟上午的错误(已经通过1.2里面的错误信息找到错误原因了),让他产生错误信息,但是这个和上午产生的错误信息不一样了,上午的我不知道错误在哪,这个就知 ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:异常问题解析!
首先遇到这样的问题,肯定是你的sql写错了,应该不用怀疑,虽然我把sql代码抽取出来在sql 单独运行了一遍,没有报错,但是还是sql语法的错误,下面先上错误的代码 <select id=&qu ...
- 已解决idea连接数据库异常:Exception in thread “main“ com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You ...
最新文章
- opencv中vc14和vc15的区别?
- 并发事务正确性的准则 可串行化_从0到1理解数据库事务(上):并发问题与隔离级别...
- mysql运行状态监控研究内容_如何监控mysql主从的运行状态shell脚本实例介绍
- 小艾k个人发卡网PHP源码
- php 周末 培训,济南php周末培训班
- iphone7p配置参数详情_华为mate40标准版参数配置-参数详情
- JUCE学习笔记04-LookAndFeel类自定义Slider颜色
- 《未来简史(下)》万维钢解读
- 提莫攻击 findPoisonedDuration
- 超详细!Jmeter性能测试(一)
- 湖大计算机学院博士后李晓灿,李蕊-湖大信息科学与工程学院
- GIC检测中断的流程
- LCD12864液晶显示
- SpringBoot中注入RedisTemplate实例异常解决
- 使用MSP430F5529的ADC测量,并用OLED显示传感器输出的模拟量
- IEC 61850 Compatible OpenPLC for Cyber Attack Case Studies on Smart Substation Systems
- markdown中编辑复杂表格
- 【2018年总】——感谢遇见,感谢拥有,感谢失去
- maven私服上传jar包
- unity2D物体朝向并靠近鼠标位置,击退效果