sql语句有问题,运行下来没问题,但好像pstmt.executeUpdate();不执行

Fetaib Fetaib 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
public void UpOperator(operator operator){ //修改操作员信息
try{
conn = DBConn.getConnection();
String sql="update operator set opName=?,opTName=?,opPass=?,sex=?,opPhone=?,remak=? where opId=?";
pstmt =conn.prepareStatement(sql);
pstmt.setString(1, operator.getOpName());
pstmt.setString(2, operator.getOpTName());
pstmt.setString(3, operator.getOpPass());
pstmt.setString(4, operator.getSex());
pstmt.setInt(5, operator.getOpPhone());
pstmt.setString(6, operator.getRemak());
pstmt.setInt(7,operator.getOpId());
//operator.getOpName()这些测试过都已经是修改以后的数值了
int a= pstmt.executeUpdate();
if(a>0){
JOptionPane.showMessageDialog(null, "修改成功!");
}else{
JOptionPane.showMessageDialog(null, "修改失败!");
}
}catch(Exception e){
e.printStackTrace();
}

}

myeclipse没有报错
...全文
评论 9
收藏 已收藏
分享
返回顶部
Fetaib
Web 开发 81,108 成员 341,721 内容