Cierra el búfer
This commit is contained in:
@@ -32,7 +32,10 @@ public class AppPrincipal {
|
||||
File ficheroPaises = new File(RUTA_FICHERO);
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
// Se carga la información del fichero en el búfer
|
||||
reader = new BufferedReader(new FileReader(ficheroPaises));
|
||||
|
||||
// Mientras el búfer esté preparado
|
||||
while (reader.ready()) {
|
||||
String linea = reader.readLine();
|
||||
|
||||
@@ -61,7 +64,11 @@ public class AppPrincipal {
|
||||
String sentenciaSQL = String.format("INSERT INTO T_PAIS (cod_continente, identificador, capital, nombre_pais) VALUES (%d, '%s', '%s', '%s');", pais.getIdentificador(), pais.getContinente().getCodigo(), pais.getCapital(), pais.getNombre());
|
||||
|
||||
System.out.println(sentenciaSQL);
|
||||
}
|
||||
|
||||
// Se cierra el búfer.
|
||||
reader.close();
|
||||
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user