标题:无法更新的错误
只看楼主
血薇
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2006-1-2
 问题点数:0 回复次数:1 
无法更新的错误
public boolean updateauthAdmin(Admin admin) throws Exception{
String updateAdmin="update admin set role=?,administrative=?,leader=?,email=?,publisher=?,village=? where id=?";
Connection conn=null;
//int validate = 0;
boolean flag=true;
try
{
conn=DatabaseConnection.getConnection();
}
catch(Exception e)
{
throw e;
}
try{
PreparedStatement pstmt=conn.prepareStatement(updateAdmin);
System.out.println(updateAdmin);
pstmt.setInt(1,admin.getKind());
System.out.println(admin.getKind());
pstmt.setString(2,admin.getAdministrative());
System.out.println("aaaaaaaaaaaaaaaaaaaa "+admin.getLeader());
pstmt.setString(3,admin.getLeader());
System.out.println(admin.getLeader());
pstmt.setString(4,admin.getEmail());
System.out.println(admin.getEmail());
pstmt.setString(5,admin.getPublisher());
System.out.println(admin.getPublisher());
pstmt.setString(6,admin.getVillage());
System.out.println(admin.getVillage());
pstmt.setInt(7,admin.getAdminId());
System.out.println(admin.getAdminId()+"GGGGGGGGGGGGGGG");
flag=pstmt.execute();
System.out.print(flag);
//validate=pstmt.executeUpdate();
//System.out.println(validate);
}catch(SQLException e){
System.out.print(e.getMessage());
}finally
{
try
{
if(conn!=null)
conn.close();
}
catch(Exception e2)
{
}
}
return flag;
}

}


参数都传上了 可无法更新   找不原因  请各位帮看看
搜索更多相关主题的帖子: public leader update admin email 
2006-12-05 12:23
独孤无痕
Rank: 1
等 级:新手上路
威 望:2
帖 子:159
专家分:0
注 册:2006-7-12
得分:0 
朋友把你程序报的错误帖上来吧

2006-12-05 12:33



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-107367-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.119224 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved