Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/08/2012, 03:39
MARIAjava
 
Fecha de Ingreso: julio-2012
Mensajes: 65
Antigüedad: 12 años, 8 meses
Puntos: 0
borrar filas tabla mysql

Hola, quiero borrar determinadas filas de una tabla llamada Jugadores. Las filas me las borra perfectamente pero luego me aparece este error: java.sql.SQLException: Operation not allowed after ResultSet closed

Y no lo entiendo ya que el resulset no lo cierro y la conexión la cierra al final. Este es el método...Gracias de antemano!!

public void borrarJuegoGuardado(int n){
Conectar conect=new Conectar();
conect.creaConexion();
Connection con = conect.dameConnection();
Statement stmt = conect.dameStatement();

try{

stmt = con.createStatement();
ResultSet res = stmt.executeQuery("SELECT * FROM Jugadores");

else if(n==4){
Object vc = vectorContador.elementAt(3);
String vcS =(String)vc;
while(res.next()){
if(res.getString("numeroJugada").compareTo(vcS)==0 ){
stmt.executeUpdate("delete from jugadores where numeroJugada="+vcS);

}
}
}

}catch (SQLException e){

System.out.println("Error6: "+e);
}

conect.cierraConexion();
}