Statement 的 execute(sql) 方法的返回值
2010-01-08 14:49
302 查看
Statement 的 execute(sql) 方法的返回值
true if the first result is a ResultSet object;
false if it is an update count or there are no resultsTop
if(sta){ // 返回值是 ResultSet
ResultSet rs=stmt.getResultSet();
..............
}
else{//
int x=stmt.getUpdateCount();
............
}
true if the first result is a ResultSet object;
false if it is an update count or there are no resultsTop
// 如果 execute的返回值是 ResultSet则返回 true
boolean sta=stmt.execute(sql);if(sta){ // 返回值是 ResultSet
ResultSet rs=stmt.getResultSet();
..............
}
else{//
int x=stmt.getUpdateCount();
............
}
相关文章推荐
- 问:SqlHelper.ExecuteReader方法返回的sqlDataReader的connection是如何关闭的?
- 使用PreparedStatement的execute方法执行sql插入语句,执行成功,但是返回结果却为false
- java.sql.PreparedStatement.executeUpdate 返回受影响
- JDBCTM中Statement接口提供的execute、executeQuery和executeUpdate之间的区别 Statement 接口提供了三种执行 SQL 语句的方法:
- Statement关于execute()方法返回值的问题
- Linq to Sql 或linq to entities 与SQL 查询结果不一致,返回重复结果问题解决方法
- DbCommand.ExecuteScalar 方法的返回值
- Hibernate通过SQL查询常量时只能返回第一个字符的解决方法
- JDBC(二) 执行SQL 之Statement及通用更新方法
- org.hibernate.exception.SQLGrammarException: could not execute statement
- SqlCommand.ExecuteScalar()方法
- Hibernate使用sql语句查询,返回实体类型的方法及注意事项
- druid 执行SQL出现错误但不影响返回结果的解决方法
- Statement三种执行SQL语句的方法
- 用原生sql查询返回实体对象的方法
- 使用JdbcTemplate的execute()方法执行SQL语句
- mysql执行preparedStatement.executeUpdate时,只返回changedRows的行数,不返回涉及到的行数的办法
- statement接口中executeUpdate()、executeQuery()、execute()方法处理
- Cause: java.sql.SQLException: Cannot execute statement: impossible to write to binary log
- EF5中 执行 sql语句使用Database.ExecuteSqlCommand 返回影响的行数 ; EF5执行sql查询语句 Database.SqlQuery 带返回值