[Jave - JDBC] executeUpdate & executeQuery & execute
1. executeUpdate
用於執行INSERT、UPDATE、DELETE語法,以及 DDL語句(如CREATE TABLE 和DROP TABLE)。
返回值為受影響的行數or更新計數(整數),而 CREATE TABLE 或 DROP TABLE 等不操作行的語法,返回值則為零 。
2. executeQuery
用於產生單個結果集(ResultSet)的語法,即SELECT語句。
3. execute
用於執行返回多個結果集、多個更新計數或二者組合的語句,一般於程式中較少使用到。
參考網址: http://peimei0808.pixnet.net/blog/post/318023961-%5Bjava%5D-statement%E4%BB%8B%E9%9D%A2%E4%B8%ADexecute%E3%80%81executequery%E5%92%8Cexecuteupd
[Jave - JDBC] executeUpdate & executeQuery & execute的更多相关文章
- executeQuery、executeUpdate 和 execute
Statement 接口提供了三种执行 SQL 语句的方法:executeQuery.executeUpdate 和 execute.使用哪一个方法由 SQL 语句所产生的内容决定. 1. Resul ...
- executeQuery,executeUpdate 和 execute 区别
http://www.360doc.com/content/14/0315/09/16068204_360719186.shtml http://i-feng.iteye.com/blog/17066 ...
- executeUpdate,executeQuery,executeBatch 的区别
executeQuery : 用于实现单个结果集,例如: Select 一般使用executeQuery 就是来实现单个结果集的工具 executeUpdate 用于执行 INSERT.UPDATE ...
- JDBC中execute、executeQuery和executeUpdate的区别
Statement 接口提供了三种执行 SQL 语句的方法:executeQuery.executeUpdate 和 execute.使用哪一个方法由 SQL 语句所产生的内容决定. 1>方法e ...
- JDBC中Statement接口提供的execute、executeQuery和executeUpdate之间的区别
Statement 接口提供了三种执行 SQL 语句的方法:executeQuery.executeUpdate 和 execute.使用哪一个方法由 SQL 语句所产生的内容决定. 方法execut ...
- execute、executeQuery和executeUpdate之间的区别 转
转:http://blog.csdn.net/colin_fantasy/article/details/3898070 execute.executeQuery和executeUpdate之间的区别 ...
- mysql 中execute、executeQuery和executeUpdate之间的区别
在用纯JSP做一个页面报警功能的时候习惯性的用executeQuery来执行SQL语句,结果执行update时就遇到问题,语句能执行,但返回结果出现问题,另外还忽略了executeUpdate的返回值 ...
- execute、executeQuery和executeUpdate之间的区别
JDBCTM中Statement接口提供的execute.executeQuery和executeUpdate之间的区别 Statement 接口提供了三种执行 SQL 语句的方法:executeQu ...
- JDBCTM中Statement接口提供的execute、executeQuery和executeUpdate之间的区别
Statement 接口提供了三种执行 SQL 语句的方法:executeQuery.executeUpdate 和 execute.使用哪一个方法由 SQL 语句所产生的内容决定. 方法execut ...
随机推荐
- ssh整合报错严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxx'
错误描述:eclipse整合ssh的时候 报不能创建名字为xxx的对象 信息: Destroying singletons in org.springframework.beans.factory.s ...
- JS中的变量和数据类型
所谓变量,就是里面存储的数据是可以改变的. 在使用变量之前,我们需要先声明变量.声明变量的关键字有var let const 在ES里面声明变量可以使用var,如下: //var 变量名 var ...
- while循环与 for循环
import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolo ...
- unity重写软键盘for Android NGUI
一 原因 以为某些原因,需要重写Unity游戏中Android的软键盘的样式,然而unity对android和ios的ios的软键盘都有封装,在Unity中TouchScreenKeyboard.Op ...
- 算数运算符& 关系运算符
java中的算数运算符 + - * / % ++ -- + +: 加法运算符 - : 减法运算符 *: 乘法运算符 / : 除法运算符 注意: 除数不能为0,除数为0会报出异常 整数运算默认得到整数, ...
- 第一条python语句!
- Java 实现ftp 文件上传、下载和删除
本文利用apache ftp工具实现文件的上传下载和删除.具体如下: 1.下载相应的jar包 commons-net-1.4.1.jar 2.实现代码如下: public class FtpUtils ...
- Python 语法1
函数的定义: """ def 函数名(): 函数内容,函数内容, 函数内容,函数内容, """ ////////////////////// ...
- GDB程序调试
GDB使用流程 1.编译生成可执行文件: gcc -g tst.c -o tst2.启动GDB gdb tst3. 在main 函数处设置断点 break main4. 运行程序 run GDB 命令 ...
- MYSQL列表中常用语句代码块
查看数据表是否存在:SHOW TABLES; 显示已经打开的数据库:SELECT DATABASE(); 查看数据表结构:SHOW COLUMNS FROM ***(数据表名): 插入数据:INSER ...