Código Javascript:
Ver original
<%@page import="java.sql.*" %> <% try { String id = request.getParameter("id"); String nom = request.getParameter("nom"); String ape = request.getParameter("ape"); String sal = request.getParameter("sal"); String sexo = request.getParameter("sexo"); String fec = request.getParameter("fec"); String ofi = request.getParameter("ofi"); String url = "jdbc:derby://localhost:1527/fabrocol"; String driver = "org.apache.derby.jdbc.ClientDriver"; String usuario = "admin"; String clave = "root"; Class.forName(driver); Connection c = DriverManager.getConnection(url, usuario, clave); Statement s = c.createStatement(); String sql = "insert into admin.frmempleados values ('"+id+"','"+nom+"','"+ape+"','"+sal+"','"+sexo+"','"+fec+"','"+ofi+"')"; int regi = s.executeUpdate(sql); if(regi>0) {out.println("Se registro con exito");} } catch ( Exception e ){ out.println ( "An exception occurred: " + e.getMessage ()) ; } %>