public void registrarCambio(int indice1, int indice2)
    {
    String url = "jdbc:derby://localhost:1527/PDPIVP";
    String selectdatos="SELECT * FROM EstructuraTabu";
    int updated=0;
    int id=0;
    int tabu=0;
    try{
    Class.forName("org.apache.derby.jdbc.ClientDriver");
    //catch SQLException
    Connection con = DriverManager.getConnection(url, "Balam", "Balam");
    Connection con1 = DriverManager.getConnection(url, "Balam", "Balam");
    Statement stmt=con.createStatement();
    ResultSet rs = stmt.executeQuery(selectdatos);
    Statement stmt1=con1.createStatement();
        for (int i=1;i<4;i++){
            rs.next();
            tabu=rs.getInt("Tabu");
            if(tabu>0){
                tabu--;
                stmt1.executeUpdate("UPDATE EstructuraTabu SET Tabu"+
                        "= "+tabu+" WHERE ID = "+i);
            }
        }
    System.out.println("indice1 "+indice1+"indice2 "+indice2);
    rs = stmt.executeQuery(selectdatos);
    rs.next();
    do{
        id=rs.getInt("ID");
        tabu=rs.getInt("Tabu");
        if(tabu==0){
                tabu=3;
                stmt1.executeUpdate("UPDATE EstructuraTabu SET Indice1"+
                        "= "+indice1+" WHERE ID = "+id);
                stmt1.executeUpdate("UPDATE EstructuraTabu SET Indice2"+
                        "= "+indice2+" WHERE ID = "+id);
                stmt1.executeUpdate("UPDATE EstructuraTabu SET Tabu"+
                        "= "+tabu+" WHERE ID = "+id);
                updated=1;
            }
        rs.next();
    }while(updated==0);
    }
    catch(ClassNotFoundException e){
        System.out.println("no se encontro la clase \n"+
                "error ClassNotFoundException");
        System.out.println(e.toString());
    }
    catch(SQLException e){
        System.out.println("error de conexion \n"+
                "error SQLException");
        System.out.println(e.toString());
    }
   }