excute,excuteUpdate,excuteQuery的区别跟用法

时间:2012-12-30 08:51:13
【文件属性】:
文件名称:excute,excuteUpdate,excuteQuery的区别跟用法
文件大小:2KB
文件格式:RAR
更新时间:2012-12-30 08:51:13
excute,excuteUpdate,excuteQuery Statement 接口提供了三种执行 SQL 语句的方法:executeQuery、executeUpdate 和 execute。使用哪一个方法由 SQL 语句所产生的内容决定。 方法executeQuery 用于产生单个结果集的语句,例如 SELECT 语句。 被使用最多的执行 SQL 语句的方法是 executeQuery。这个方法被用来执行 SELECT 语句,它几乎是使用最多的 SQL 语句。 -------------------------- stmt.execute(queryStringWithUnknownResults); while (true) { int rowCount = stmt.getUpdateCount(); if (rowCount > 0) { // 它是更新计数 System.out.println("Rows changed = " + count); stmt.getMoreResults(); continue; }
【文件预览】:
excute,excuteUpdate,excuteQuery.txt

网友评论

  • 资料详细,细致。谢谢上传者