加上while(rs.next()) 就出提取违反顺序 错误
publicStringdel(Vector<String>v){//从连接池获取数据库连接conn=StartConPoolBean.connPool.getConne...
public String del(Vector<String> v)
{
//从连接池获取数据库连接
conn= StartConPoolBean.connPool.getConnection();
//SQL 语句
String querySQL = "DELETE BASE_USER WHERE USER_ID = ?";
try {
ps = conn.prepareStatement(querySQL);
// 参数赋值 迭代器
Iterator<String> 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 "删除成功";
}
提取违反顺序 该怎么改啊? 展开
{
//从连接池获取数据库连接
conn= StartConPoolBean.connPool.getConnection();
//SQL 语句
String querySQL = "DELETE BASE_USER WHERE USER_ID = ?";
try {
ps = conn.prepareStatement(querySQL);
// 参数赋值 迭代器
Iterator<String> 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 "删除成功";
}
提取违反顺序 该怎么改啊? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询