SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=? java.sql.SQLException:SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=?java.sql.SQLException: Can not issue executeUpdate() for SELECTsat com.mysql.

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 08:42:46
SQL>selectcount(*)fromTeacherwhereteacherCode=?andteacherPassword=?java.sql.SQLException:SQL>selectc

SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=? java.sql.SQLException:SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=?java.sql.SQLException: Can not issue executeUpdate() for SELECTsat com.mysql.
SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=? java.sql.SQLException:
SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=?
java.sql.SQLException: Can not issue executeUpdate() for SELECTs
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
public int execOther(final String strSQL, final Object[] params){
this.fetchFreeConnection();
try {
this.pstmt = this.conn.prepareStatement(strSQL);
System.out.println(new Date()+"\nSQL >"+strSQL);
for (int i = 0; i < params.length; i++) {
this.pstmt.setObject(i+1, params[i]);
}
int count = this.pstmt.executeUpdate();
return count;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return -1;
}
}

SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=? java.sql.SQLException:SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=?java.sql.SQLException: Can not issue executeUpdate() for SELECTsat com.mysql.
int count = this.pstmt.executeUpdate();
改为
int count = this.pstmt.executequery();
你执行的是select语句,调用的确实update方法.查询语句要是用查询的方法.

SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=? java.sql.SQLException:SQL >select count(*) from Teacher where teacherCode=? and teacherPassword=?java.sql.SQLException: Can not issue executeUpdate() for SELECTsat com.mysql. $sql=SELECT count(*) as pcount FROM news 和$sql = UPDATE article SET这句是什么意思? select count(*) from table1 select count(*) from table2 select count(*) from table3我从table1 table2 table3 中 找数据的条数怎样一下子用一条sql语句 算出TABLE1 TABLE2 TABLE3 记录的总和? select count和select count的区别 select id,name from student where id in ( select id from score having count(id)>=2 );以上这段语句有没语法错误.SQL语句 sql语句的用法:select as-->>select count(*) as count from table;记录总数保存在count中了,在jsp中这个count怎么用呢,也是就说怎样把这个count的值取出来.直接 int c = count;行吗?或者别的 select count(*)count 什么意思和select * 有什么区别 select count(*) from 怎么使用 select count(1) from emp and select 4718 fromselect count SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0select * from B where (select count(1) as num from A where A.ID = B.ID) = 0请问如何理解,为什么 可以在B表中 排除A表的数据 sql语句中count(*)与count(abc)的区别我想统计t_abc这张表中abc字段的基数,分别执行以下两种:一:SELECT abd,COUNT(*) 数量FROM t_abcgroup by abc二:SELECT abd,COUNT(abc) 数量FROM t_abcgroup by abc执行结果一 select a.* from test a where 1 > (select count(*) from test where name = a.name and val > a.val )sql语句,按name分组显示最大的val值的字段,不明白具体意思, sql函数,select count(A.abc) as sum from A left join B on A.id=B.id where A.abc='1' group by A.abc结果是 sum 234怎么求count(A.abc) as sum 的总数. SQL里的DISTINCT什么意思SELECT Sno,AVG(Grade)FROM SCGROUP BY SnoHAVING COUNT(DISTINCT(Sno))>1;既然已经按Sno分类了,再用DISTINCT那HAVING COUNT(DISTINCT(Sno))的值岂不是只能为1? SQL的GROUP BY错误SELECT SUM(ADMIN_ENTERED)FROM STATEGROUP BY YEAR_ENTEREDHAVING COUNT(YEAR_ENYERED)=MAX(COUNT(YEAR_ENTERED))系统提示::ERROR at line 4:ORA-00935:group function is nested too deeply 这是表格:CREATE TABLE STATE(STATE_NAM SQL 语句 SELECT * FROM {{table}} WHERE `fleet_end_time` if (dt.Rows.Count > 0)求注释求每行代码的注释,protected void InitData(){string id = Request[ID].ToString();try{string sql = select * from TB_MeiShi where ID= + id;DataTable dt = DBHelper.GetDataSet(sql).Tables[0];//执行sql语句从数