Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
- <sqlMap namespace="Cliente">
- <procedure id="listarcliente" resultClass="controller.Cliente">
- { call ListarClientes() }
- </procedure>
- </sqlMap>
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
- <sqlMapConfig>
- <settings useStatementNamespaces="true"/>
- <transactionManager type="JDBC">
- <dataSource type="SIMPLE">
- <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
- <property name="JDBC.ConnectionURL" value="jdbc:mysql://localhost:3306/cibertec2018"/>
- <property name="JDBC.Username" value="root"/>
- <property name="JDBC.Password" value="mysql"/>
- </dataSource>
- </transactionManager>
- <sqlMap resource="Cliente.xml"/>
- </sqlMapConfig>
- public class Cliente {
- private int idcliente;
- private String nombres;
- private String ciudad;
- private String sexo;
- private String telefono;
- private String fecha_nacimiento;
- public Cliente() {
- }
- public Cliente(int idcliente, String nombres, String ciudad, String sexo, String telefono, String fecha_nacimiento) {
- this.idcliente = idcliente;
- this.nombres = nombres;
- this.ciudad = ciudad;
- this.sexo = sexo;
- this.telefono = telefono;
- this.fecha_nacimiento = fecha_nacimiento;
- }
- public int getIdcliente() {
- return idcliente;
- }
- public void setIdcliente(int idcliente) {
- this.idcliente = idcliente;
- }
- public String getNombres() {
- return nombres;
- }
- public void setNombres(String nombres) {
- this.nombres = nombres;
- }
- public String getCiudad() {
- return ciudad;
- }
- public void setCiudad(String ciudad) {
- this.ciudad = ciudad;
- }
- public String getSexo() {
- return sexo;
- }
- public void setSexo(String sexo) {
- this.sexo = sexo;
- }
- public String getTelefono() {
- return telefono;
- }
- public void setTelefono(String telefono) {
- this.telefono = telefono;
- }
- public String getFecha_nacimiento() {
- return fecha_nacimiento;
- }
- public void setFecha_nacimient(String fecha_nacimiento) {
- this.fecha_nacimiento = fecha_nacimiento;
- }
- }
- <%@page import="controller.IbatisrRead"%>
- <%@page import="java.util.ArrayList" %>
- <%@page import="controller.Cliente" %>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Listado de productos</title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
- <%
- IbatisrRead objRead = new IbatisrRead();
- ArrayList<Cliente> obj = new ArrayList<Cliente>();
- obj = objRead.Listado();
- %>
- </head>
- <body>
- <div class="container">
- <h1>Listado de clientes</h1>
- <table class="table table-bordered">
- <thead>
- <th>IdCliente</th>
- <th>Nombres</th>
- <th>Ciudad</th>
- <th>Sexo</th>
- <th>Telefono</th>
- <th>Fecha Nacimiento</th>
- <th></th>
- </thead>
- <tbody>
- <!-- iniciar recorrido-->
- <% for(Cliente c: obj){ %>
- <tr>
- <td>
- <%=c.getIdcliente() %>
- </td>
- <td>
- <%=c.getNombres() %>
- </td>
- <td>
- <%=c.getCiudad() %>
- </td>
- <td>
- <%=c.getSexo() %>
- </td>
- <td>
- <%=c.getTelefono()%>
- </td>
- <td>
- <%=c.getFecha_nacimiento()%>
- </td>
- <td>
- <a href="#">Editar</a> |
- <a href="#" onclick="Confirmar(<%= c.getIdcliente()%>)">Eliminar</a>
- </td>
- </tr>
- <%}%>
- </tbody>
- </table>
- <a href="NuevoRegistro.jsp" class="btn btn-primary">Registrar clientes</a>
- <a href="BuscarProducto.jsp" class="btn btn-primary">Buscar clientes</a>
- </div>
- </body>
- </html>
- <script>
- function Confirmar(id){
- if (confirm("¿Desea eliminar el registro " + id + "?")) {
- location.href = "/ExamenEL3/Delete.jsp?id=" + id;
- }
- }
- </script>
Add Comment
Please, Sign In to add comment