first commit

This commit is contained in:
felipe.garcia3
2026-09-29 17:38:41 +02:00
commit 17162308fb
11 changed files with 168 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View File
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Actividad1.2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
+11
View File
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=25
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=25
Binary file not shown.
Binary file not shown.
Binary file not shown.
+55
View File
@@ -0,0 +1,55 @@
package org.paloma.aadd.fgm;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import org.paloma.aadd.fgm.vo.Continente;
import org.paloma.aadd.fgm.vo.Pais;
public class Fichero2 {
public static void main(String[] args) {
imprimirInformacionPaises("C:\\Users\\alumnoT\\aadd\\fic02\\informacion_paises.txt");
}
public static void imprimirInformacionPaises(String rutaFichero) {
try (BufferedReader br = new BufferedReader(new FileReader(rutaFichero))) {
String linea;
while ((linea = br.readLine()) != null) {
if (linea.startsWith("#")) {
continue;
} else if (linea.startsWith("-")) {
continue;
}
String[] campos = linea.split(",");
String codContinente = campos[0].replace("\"", "");
String idStr = campos[1].replace("\"", "");
String nombrePais = campos[2].replace("\"", "");
String capital = campos[3].replace("\"", "");
Continente c = new Continente();
c.setCodigo(codContinente);
Pais p = new Pais();
p.setIdentificador(Integer.parseInt(idStr));
p.setNombre(nombrePais);
p.setCapital(capital);
p.setContinente(c);
System.out.println(p);
System.out.println("INSERT INTO T_PAIS (cod_continente, identificador, capital, nombre_pais) VALUES (" + idStr + ", '" + codContinente + "', '"+ capital + "', '"+ nombrePais + "');");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,30 @@
package org.paloma.aadd.fgm.vo;
public class Continente {
private String codigo;
private String nombre;
public String getCodigo() {
return codigo;
}
public void setCodigo(String codigo) {
this.codigo = codigo;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
@Override
public String toString() {
return "Continente [codigo=" + codigo + ", nombre=" + nombre + "]";
}
}
+43
View File
@@ -0,0 +1,43 @@
package org.paloma.aadd.fgm.vo;
public class Pais {
private int identificador;
private String nombre;
private String capital;
private Continente continente;
public int getIdentificador() {
return identificador;
}
public void setIdentificador(int identificador) {
this.identificador = identificador;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getCapital() {
return capital;
}
public void setCapital(String capital) {
this.capital = capital;
}
public Continente getContinente() {
return continente;
}
public void setContinente(Continente continente) {
this.continente = continente;
}
@Override
public String toString() {
return "Pais [identificador=" + identificador + ", nombre=" + nombre + ", capital=" + capital + ", continente=" + continente + "]";
}
}