无法更新的错误
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;
}
}
参数都传上了 可无法更新 找不原因 请各位帮看看