转:

Can not issue data manipulation statements with executeQuery()错误解决

2012年03月27日 15:47:52 katalya 阅读数:79830 标签: insert数据库sql
 
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cherishme1988/article/details/7399225

 强烈建议:尽信书,不如无书!!!

下午没事,就练习了下连接数据库,结果发现了一个问题,哈哈

Can not issue data manipulation statements with executeQuery()

原因是这句:st.executeQuery("insert  into  student  values('"+name+"','"+age+"','"+introduce+"')") ;

我是看了书上一个例子,然后开始模仿,发现问题后,发现书上其他程序语句都是用这句,

后来看了几个网页,才明白这句应该该成这样子:st.execute("insert  into  student  values('"+name+"','"+age+"','"+introduce+"')") ;

最后总结:如果你的SQL 语句是诸如update,insert的更新语句,应该用statement的execute()方法,如果用的是statement的executeQuery()就会出现上诉问题

Can not issue data manipulation statements with executeQuery()错误解决的更多相关文章

  1. Can not issue data manipulation statements with executeQuery().解决方案

    这个错误提示是说无法发行sql语句到指定的位置 错误写法: 正确写法: excuteQuery是查询语句,而我要调用的是更新的语句,所以这样数据库很为难到底要干嘛,实际我想用的是更新,但是我写成了查询 ...

  2. java.sql.SQLException: Can not issue data manipulation statements with executeQuery().

    1.错误描写叙述 java.sql.SQLException: Can not issue data manipulation statements with executeQuery(). at c ...

  3. Can not issue data manipulation statements with executeQuery()的解决方案

     Can not issue data manipulation statements with executeQuery() 报错的解决方案: 把“ResultSet rs = statement. ...

  4. Can not issue data manipulation statements with executeQuery() 异常处理

    1.这个异常的报错翻译过来就是 不能发出数据操纵语句与executeQuery() 2.这里要检查一下你要执行的实际SQL语句要做什么操作 查询呢?还是修改? 3.如果是修改的话,需要添加@Modif ...

  5. Can not issue data manipulation statements with executeQuery().解决的方法

    query是查询用的,而update是插入和更新,删除修改用的. executeQuery()语句是用于产生单个结果集的语句,如select语句,在什么情况下用,当你的数据库已经保存了数据后,要进行查 ...

  6. Can not issue data manipulation statements with executeQuery().

    这个错误提示是说无法发行sql语句到指定的位置 就是如图的两端代码的问题,excuteQuery是查询语句,而我要调用的是更新的语句,所以这样数据库很为难到底要干嘛,我实际的操作是要更新数据,所以把 ...

  7. Best packages for data manipulation in R

    dplyr and data.table are amazing packages that make data manipulation in R fun. Both packages have t ...

  8. The dplyr package has been updated with new data manipulation commands for filters, joins and set operations.(转)

    dplyr 0.4.0 January 9, 2015 in Uncategorized I’m very pleased to announce that dplyr 0.4.0 is now av ...

  9. 【转】Hive Data Manipulation Language

    Hive Data Manipulation Language Hive Data Manipulation Language Loading files into tables Syntax Syn ...

随机推荐

  1. JSP从入门到精通

    1. jsp开发环境配置 在windows下配置jsp的开发环境: 假设已经安装好了jdk,下面来配置tomcat 去http://tomcat.apache.org 下载tomcat windows ...

  2. pip 升级

    pip install --upgrade qrcode pip install --upgrade qrcode==5.3

  3. Java多线程之synchronized线程锁

    package org.study2.javabase.ThreadsDemo.sync; /** * @Auther:GongXingRui * @Date:2018/9/18 * @Descrip ...

  4. mybatis 批量查询参数语句

    在mybatis  传入数组在sql语句中进行查询 1.传入一个map集合,已或者的形式拼接数组循环 <select id="selectUserByList" parame ...

  5. sql left join多表

    表A---------------------------------关联第一张表B-----------------------关联第二张表c select * fomr 表名A left join ...

  6. Js--String、Date、Array对象

    /* * String 对象 属性 length 方法 */ //String的length属性 var strL = "abcde"; document.write(" ...

  7. Spring Boot 构建电商基础秒杀项目 (八) 商品创建

    SpringBoot构建电商基础秒杀项目 学习笔记 新建数据表 create table if not exists item ( id int not null auto_increment, ti ...

  8. 二、Java多人博客系统-演变

    任何项目都是由小到大,逐步演变的.自己写的这个博客系统也不例外. 更新日志如下: 一.2014年底-2015年初 功能及技术: 1.定位为个人网站,介绍自己情况和发布文章等. 2.首页模块有:个人简介 ...

  9. 洛谷P1007独木桥题解

    题目 这个题看起来很难,但是只要理解了题目,一切都显得简单. 你只需想象出来每个人在碰撞之后仅仅是交换了灵魂, 这样一来,代码就好写了. 附代码: #include<iostream> # ...

  10. centos6.8下普通用户下quartus编程识别不到用户开发板

    前言 centos6.8下su用户下可以识别到用户的板子,能正常下板,而普通用户下无法探测到用户板子. 需要配置一下usb-blaster,不然的话,虽然quartus软件能识别,但是无法探测到FPG ...