当前位置: 代码迷 >> J2SE >> 大家好,请帮小弟我看上小弟我的这段代码如何不能修改数据
  详细解决方案

大家好,请帮小弟我看上小弟我的这段代码如何不能修改数据

热度:84   发布时间:2016-04-24 00:29:40.0
大家好,请帮我看下我的这段代码怎么不能修改数据
conn = dataop.getConn(); stmt = dataop.getStmt(conn); StringBuilder str = new StringBuilder("update topwellcrm.edu_person_info set edu_person_info.mobilePhone = '"+mobilePhone+"' where edu_person_info.username='"+username+"' ");// StringBuilder str_authority = new StringBuilder("select passwd from security_users where username='"+username+"'"); String sql = str.toString(); //System.out.println("打印sql"); rs = stmt.executeQuery(sql);
谢谢大家


------解决方案--------------------
楼主,你要修改代码的话就要用executeUpdate方法,executeQuery是查询数据
  相关解决方案