Executes the given SQL statement, which may return multiple results. In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.
The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).
Parameters:
sql - any SQL statement
Returns:
true if the first result is a ResultSet object; false if it is an update count or there are no results
该方法是为了执行参数sql语句的,他可能返回多种返回值。在一些不常见的情况下,一个语句有可能返回多个返回值(返回值集或更新个数)。一般情况下,我们可以不必在意这个问题,除非是用来执行一个存储过程或者执行一个未知的动态的sql语句。
这个execute方法执行一个sql语句并且指向第一个返回值。你必须使用getResultSet或者getUpdateCount方法去获得返回值,也可以使用getMoreResults来获得一系列的返回值。
参数:
任意的sql语句
返回值:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
true表示第一个返回值是一个ResultSet对象;false表示这是一个更新个数或者没有结果集。
分享到:
相关推荐
主要介绍了Asp Conn.execute的参数与返回值总结,数据库对象的execute方法参数与返回值总结,需要的朋友可以参考下
connection对象的execute方法
ExecutorService的execute和submit方法
执行指定的查询、SQL 语句、存储过程或特定提供者的文本等内容。
execSQL和SQLiteStatement的executeInsert方法插入1000条数据所需要的时间对比
Oracle中EXECUTE IMMEDIATE用法
主要介绍了Struts2中Action中是否需要实现Execute方法的相关资料,需要的朋友可以参考下
parastatement的方法 博文链接:https://shangdiyefankun.iteye.com/blog/104482
EXECUTE
MySQL官方将prepare、execute、deallocate统称为PREPARE STATEMENT,我习惯称其为【预处理语句】,其用法十分简单,下面话不多说,来一起看看详细的介绍吧。 示例代码 PREPARE stmt_name FROM preparable_stmt ...
Server.Execute方法执行指定的ASP程序
Execute runner
failed to execute script 解决方案+命令行执行传参exe
ExecuteSQL.java
MarkDown文档,意在说明线程池方法:submit()和execute()方法的区别
delegate_execute.exe
execute immediate 用法研究 为初学者打造。
下面小编就为大家带来一篇ThreadPoolExecutor线程池原理及其execute方法(详解)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Python 3.85 使用pyinstaller在win10 x64下打包的应用程序,在win10 x64下运行完全正常,但是在win7 x64下则报错。failed to execute script pyi_rth_ pyi_rth_xxx 解决方法