相同点

  execute与executeUpdate的相同点:都可以执行增加,删除,修改

不同点

  execute可以执行查询语句
  然后通过getResultSet,把结果集取出来
  executeUpdate不能执行查询语句

  execute返回boolean类型,true表示执行的是查询语句,false表示执行的是insert,delete,update等等
  executeUpdate返回的是int,表示有多少条数据受到了影响

JDBC中 execute 与 executeUpdate的区别的更多相关文章

  1. JDBC预编译statement(preparedstatement)和statement的比较、execute与executeUpdate的区别

    和 Statement一样,PreparedStatement也是用来执行sql语句的与创建Statement不同的是,需要根据sql语句创建PreparedStatement除此之外,还能够通过设置 ...

  2. JDBC中execute、executeQuery和executeUpdate的区别

    Statement 接口提供了三种执行 SQL 语句的方法:executeQuery.executeUpdate 和 execute.使用哪一个方法由 SQL 语句所产生的内容决定. 1>方法e ...

  3. 浅谈 JDBC 中 CreateStatement 和 PrepareStatement 的区别与优劣

    先说下这俩到底是干啥的吧.其实这俩干的活儿都一样,就是创建了一个对象然后去通过对象调用executeQuery方法来执行sql语句.说是CreateStatement和PrepareStatement ...

  4. ThreadPoolExecutor中execute和submit的区别

    1:入参不同 excute() 传入的是 Runable, submit 传入的是 Callable 或 Runable 1):execute 方法源码 public void execute(Run ...

  5. JDBC中prepareStatement 和Statement 的区别

    package util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedSta ...

  6. JDBC中PreparedStatement和Statement的区别

    共同点: PreparedStatement和Statement都是用来执行SQL查询语句的API之一. 不同点: 在PreparedStatement中,当我们经常需要反复执行一条结构相似的sql语 ...

  7. JDBC中的Statement和PreparedStatement的区别

    JDBC中的Statement和PreparedStatement的区别  

  8. execute、executeUpdate、executeQuery三者的区别(及返回值)

    1. ResultSet executeQuery(String sql); 执行SQL查询,并返回ResultSet 对象. 2.int executeUpdate(String sql); 可执行 ...

  9. 请教JDBC中的thin和OCI的区别\

    请教JDBC中的thin和OCI的区别 https://zhidao.baidu.com/question/2267123737573204748.html

随机推荐

  1. oracle行转列,列转行

    多行转字符串这个比较简单,用||或concat函数可以实现 SQL Code select concat(id,username) str from app_userselect id||userna ...

  2. Agreementhasbeenupdated--EditPhoneNumber

    1.https://appleid.apple.com/#!&page=signin 登录appid账号  在账户里面的编辑 添加更多信息,新增手机号 2.如果不可以 可以试下这个https: ...

  3. eclipse整合spring+springMVC+Mybatis

    一.新建Maven项目 点击菜单栏File项,选择New->Project,选中Maven Project,如下图: 二.配置pom.xml <?xml version="1.0 ...

  4. c#按照指定长度切分字符串

    int pageSize=5; var array = new List<string>(); ----------方法1-------------------- var pageCoun ...

  5. PAT 1032 Sharing[hash][链表][一般上]

    1032 Sharing (25)(25 分) To store English words, one method is to use linked lists and store a word l ...

  6. [LeetCode] 513. Find Bottom Left Tree Value_ Medium tag: BFS

    Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 ...

  7. jmeter Bean Shell的使用(二)

    BeanShell的用法 在此介绍下BeanShell PreProcessor的用法,其它的beahshell可以类推.在此我们使用beahshell调用自己写的工具类,工具类实现了密码的加.解密功 ...

  8. winfrom 下 listbox 选项添加value

    public struct MyItem { public string Name; public string Tag; public override string ToString() { re ...

  9. mysql表结构文件

  10. uva11865 朱刘算法+二分

    这题说的需要最多花费cost元来搭建一个比赛网络,网络中有n台机器,编号为0 - n-1其中机器0 为服务器,给了n条线有向的和他们的花费以及带宽 计算,使得n台连接在一起,最大化网络中的最小带宽, ...