加上while(rs.next()) 就出提取违反顺序 错误public String del(Vector v){//从连接池获取数据库连接conn= StartConPoolBean.connPool.getConnection();//SQL 语句String querySQL = "DELETE BASE_USER WHERE USER_ID = ?"; 

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/20 09:39:30
加上while(rs.next())就出提取违反顺序错误publicStringdel(Vectorv){//从连接池获取数据库连接conn=StartConPoolBean.connPoo

加上while(rs.next()) 就出提取违反顺序 错误public String del(Vector v){//从连接池获取数据库连接conn= StartConPoolBean.connPool.getConnection();//SQL 语句String querySQL = "DELETE BASE_USER WHERE USER_ID = ?"; 
加上while(rs.next()) 就出提取违反顺序 错误
public String del(Vector v)
{
//从连接池获取数据库连接
conn= StartConPoolBean.connPool.getConnection();
//SQL 语句
String querySQL = "DELETE BASE_USER WHERE USER_ID = ?";

 try {

ps = conn.prepareStatement(querySQL);

// 参数赋值 迭代器
Iterator it = v.iterator();

ps.setString(1, it.next());


// 结果集
ResultSet rs = ps.executeQuery();
while(rs.next())
{

rs.getString("USER_ID");
}

// 关闭
StartConPoolBean.connPool.free(rs, ps, conn);

} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "无法删除";
}
return "删除成功";
}
提取违反顺序 该怎么改啊?

加上while(rs.next()) 就出提取违反顺序 错误public String del(Vector v){//从连接池获取数据库连接conn= StartConPoolBean.connPool.getConnection();//SQL 语句String querySQL = "DELETE BASE_USER WHERE USER_ID = ?"; 
while(rs.hasNext()){
  rs.next();
  }