From c92fa5253c619d06f871281be6f68b5cc6cdd813 Mon Sep 17 00:00:00 2001 From: Yovan Martinez Date: Wed, 11 May 2022 15:01:55 -0400 Subject: [PATCH] Creado el formulario y el objeto postulante --- src/main/java/Postulante/PostulanteDao.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/entity/Postulante.java | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/webapp/formulario.html | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 194 insertions(+) create mode 100644 src/main/java/Postulante/PostulanteDao.java create mode 100644 src/main/java/entity/Postulante.java create mode 100644 src/main/webapp/formulario.html diff --git a/src/main/java/Postulante/PostulanteDao.java b/src/main/java/Postulante/PostulanteDao.java new file mode 100644 index 0000000..a591b7d --- /dev/null +++ b/src/main/java/Postulante/PostulanteDao.java @@ -0,0 +1,41 @@ +package Postulante; +import com.roshka.proyectofinal.Postulante; + +import java.util.*; +import java.sql.*; + +public class PostulanteDao { + + public static Connection getConnection(){ + Connection con=null; + try{ + Class.forName("oracle.jdbc.driver.OracleDriver"); + con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); + }catch(Exception e){System.out.println(e);} + return con; + } + public static int save(Postulante postulante){ + int status=0; + try{ + Connection con=EmpDao.getConnection(); + PreparedStatement ps=con.prepareStatement( + "insert into postulante(name,password,email,country) values (?,?,?,?)"); + ps.setString(1,postulante.getNombre()); + ps.setString(2,postulante.getApellido()); + ps.setString(1,postulante.getNombre()); + ps.setString(2,postulante.getApellido()); + ps.setString(1,postulante.getNombre()); + ps.setString(2,postulante.getApellido()); + ps.setString(1,postulante.getNombre()); + ps.setString(2,postulante.getApellido()); + ps.setInt(3,postulante.getNro_cedula()); + ps.setString(4,postulante.getCountry()); + + status=ps.executeUpdate(); + + con.close(); + }catch(Exception ex){ex.printStackTrace();} + + return status; + } +} diff --git a/src/main/java/entity/Postulante.java b/src/main/java/entity/Postulante.java new file mode 100644 index 0000000..c4a4c46 --- /dev/null +++ b/src/main/java/entity/Postulante.java @@ -0,0 +1,93 @@ +package com.roshka.proyectofinal; + +//Creacion del objeto Postulante +public class Postulante { + + private int id,nroCedula; + private String nombre,apellido,telefono,direccion,correo; + private boolean expLaboral,estudioUniversitario,notebook,bootcampId,aceptado; + + //Los parametros que reciban los metodos get estaran en ingles con camelCase para evitar confusiones + + + public Postulante() { + } + + public Postulante(int nroCedula, String nombre, String apellido, String telefono, String direccion, String correo, boolean expLaboral, boolean estudioUniversitario, boolean notebook, boolean bootcampId, boolean aceptado) { + this.nroCedula = nroCedula; + this.nombre = nombre; + this.apellido = apellido; + this.telefono = telefono; + this.direccion = direccion; + this.correo = correo; + this.expLaboral = expLaboral; + this.estudioUniversitario = estudioUniversitario; + this.notebook = notebook; + this.bootcampId = bootcampId; + this.aceptado = aceptado; + } + public int getId() { + return id; + } + public int getNro_cedula() { + return nroCedula; + } + public void setNro_cedula(int card_id) { + this.nroCedula = card_id; + } + public String getNombre() { + return nombre; + } + public void setName(String name) { + this.nombre = name; + } + public String getApellido() { + return apellido; + } + public void setApellido(String lastName) { + this.apellido = lastName; + } + public String getTelefono() { + return telefono; + } + public void setTelefono(String telephone) { + this.telefono = telephone; + } + public String getDireccion() { + return direccion; + } + public void setDireccion(String addres) { + this.direccion = addres; + } + public String getCorreo() { + return correo; + } + public void setCorreo(String email) { + this.correo = email; + } + public boolean getExpLaboral(){ + return expLaboral; + } + public void setExpLaboral(boolean laboralExperience){ + this.expLaboral = laboralExperience; + } + public boolean getEstudioUniversitario(){ + return estudioUniversitario; + } + public void setEstudioUniversitario(boolean university){ + this.estudioUniversitario = university; + } + public boolean getNotebook(){ + return notebook; + } + public void setNotebook(boolean notebook){ + this.notebook = notebook; + } + public boolean getBootcampId(){ + return bootcampId; + } + public void setBootcampId(boolean bootcampId){ + this.bootcampId = bootcampId; + } + +} diff --git a/src/main/webapp/formulario.html b/src/main/webapp/formulario.html new file mode 100644 index 0000000..1e2c9eb --- /dev/null +++ b/src/main/webapp/formulario.html @@ -0,0 +1,60 @@ + + + + + + + + + postulacion + + + +
+ + +
+

Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:

+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + + +
+ + +
+ + +
+ + + +
+
+ +
+ + + \ No newline at end of file -- libgit2 0.26.0