executeQuery和executeUpdate java中的substring和sql中的substring
来源:互联网 发布:网络剧受众画像 编辑:程序博客网 时间:2024/05/01 23:11
1 Statement 接口提供了三种执行 SQL 语句的方法:executeQuery、executeUpdate 和 execute。
方法executeQuery
用于产生单个结果集的语句,例如 SELECT 语句。 被使用最多的执行 SQL 语句的方法是 executeQuery。这个方法被用来执行 SELECT 语句,它几乎是使用最多的 SQL 语句。
方法executeUpdate
用于执行 INSERT、UPDATE 或 DELETE 语句以及 SQL DDL(数据定义语言)语句,例如 CREATE TABLE 和 DROP TABLE。INSERT、UPDATE 或 DELETE 语句的效果是修改表中零行或多行中的一列或多列。executeUpdate 的返回值是一个整数,指示受影响的行数(即更新计数)。对于 CREATE TABLE 或 DROP TABLE 等不操作行的语句,executeUpdate 的返回值总为零。
使用executeUpdate方法是因为在 createTableCoffees 中的 SQL 语句是 DDL (数据定义语言)语句。创建表,改变表,删除表都是 DDL 语句的例子,要用 executeUpdate 方法来执行。你也可以从它的名字里看出,方法 executeUpdate 也被用于执行更新表 SQL 语句。实际上,相对于创建表来说,executeUpdate 用于更新表的时间更多,因为表只需要创建一次,但经常被更新。
2
java:"Hello World".substring(6,11); 含义[6,11) 其中两个数字代表索引,索引位置从0开始。
SQL:substring("Hello World",7,5); 第一个数字代表开始位置(索引从1开始),第二个数字代表长度
- executeQuery和executeUpdate java中的substring和sql中的substring
- java中的substring 和stringtokenizer
- java中的substring和c++中的substr
- PreparedStatement中的execute、executeQuery和executeUpdate之间的区别
- Java和js中的boolean, split ,substring
- oracle 的 substr 和java中的substring
- Java String中的indexof 和 substring 用法
- executeQuery()、executeUpdate() 和 execute()
- executeQuery、executeUpdate和execute
- JDK6和JDK7中的substring()
- Mysql中的LOCATE 和 SUBSTRING
- Java中的String中的substring、indexof()、lastindexof()和split
- JDBC - executeQuery、executeUpdate 和 execute
- JDBC execute、executeQuery和executeUpdate
- substring()在JAVA,C#,SQL中的区别
- java中的 substring
- Java中的subString()方法
- sql语句 execute、executeQuery和executeUpdate之间的区别
- 利用powerDesigner逆向导出oracle表为PDM
- UIKit---UITextField详解
- Could not open a connection to your authentication agent
- 机器学习实践中的7种常见错误
- 图片中线条的细化处理实验
- executeQuery和executeUpdate java中的substring和sql中的substring
- 关于OptionsPlay如何进行行情更新分析
- Perform Two Phase Commits in MongoDB
- codeforces 526 c Om Nom and Candies 剩余系
- 有关VS2010的sdf文件和ipch文件夹
- JAVA数据类型
- 数据库索引
- Product Owner 需扪心自问的一个问题
- c#爬取Silverlight网页 2