INSERTAR REGISTROS A MYSQL DESDE JSP

Diseñar el siguiente formulario.


Diseñar la tabla usuarios en Mysql.










index.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <style type="text/css">
            input{
                border-radius:10px;
                box-shadow:0px 0px 25px rgba(30,144,255,0.3) inset;
                width: 200px;
                height: 30px;
                padding: 5px;
                margin: 5px;

            }
            #contenedor{
                width: 500px;
                border: 1px solid rgba(255,255,255,0.4);
                padding: 20px;
                margin: 50px;
                border-radius: 25px 25px 25px 25px;
                box-shadow:0px 10px 25px #0066cc;
                border-color: #ffffff;

            }
            td{
                text-align: right;
                font-size: 25px italic;

            }

        </style>
    </head>
    <body>


    <center>
        <h3>MANTENIMIENTO DE USUARIO</h3>
        <hr color="#003399"/>
        <div id="contenedor">
            <form action="registrar.jsp" method="post">
                <table>

                    <tr>
                        <td>Código:</td>
                        <td> <input type="text" name="txtcod" required="" maxlength="5" /> </td>
                    </tr>
                    <tr>
                        <td>Usuario:</td>
                        <td> <input type="text" name="txtusu" required="" /> </td>
                    </tr>
                    <tr>
                        <td>Clave:</td>
                        <td> <input type="password" name="txtcla" required="" /> </td>
                    </tr>

                    <tr>
                        <td colspan="2" align="center"> <input type="submit"   name="btngrabar" /> </td>
                    </tr>
            </form>
            </table>  
            </form>

        </div>

    </center>
</body>

</html>

registrar.jsp


























cls_conexion.java


cls_usuario.java









No hay comentarios:

Publicar un comentario