Guest User

Untitled

a guest
Feb 15th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
  2. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  6. <title>Insertar Cuotas</title>
  7. </head>
  8. <body>
  9. <form action="EjecutarInsertar" method="POST" >
  10. <table>
  11. <tr>
  12. <td>
  13. <label for="cuota1">Cuota 1:</label>
  14. </td>
  15. <td>
  16. <input name="cuota1" type="number" min="1" step="0.01"/>
  17. </td>
  18. </tr>
  19. <tr>
  20. <td>
  21. <label for="cuota2">Cuota 2:</label>
  22. </td>
  23. <td>
  24. <input name="cuota2" type="number" min="1" step="0.01"/>
  25. </td>
  26. </tr>
  27. <tr>
  28. <td>
  29. <label for="cuota3">Cuota 3:</label>
  30. </td>
  31. <td>
  32. <input name="cuota3" type="number" min="1" step="0.01"/>
  33. </td>
  34. </tr>
  35. <tr>
  36. <td>
  37. <label for="cuota4">Cuota 4:</label>
  38. </td>
  39. <td>
  40. <input name="cuota4" type="number" min="1" step="0.01"/>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td colspan="2">
  45. <button type="submit">Insertar</button><br/>
  46. <button type="reset">Limpiar</button><br/>
  47. <button type="button"> <sql:query var="cuota1" dataSource="ds">
  48. SELECT (cuota1*cuota2*cuota3*cuota4) AS resultado FROM cuotas WHERE ID='5';
  49. </sql:query>
  50. </td>
  51. </tr>
  52. </table>
  53. </form>
  54. </body>
  55. </html>
  56.  
  57. @Bean
  58. public DriverManagerDataSource dataSource(){
  59. DriverManagerDataSource ds=new DriverManagerDataSource();
  60. ds.setDriverClassName("com.mysql.jdbc.Driver");
  61. ds.setUrl("jdbc:mysql://localhost:3306/apuestas");
  62. ds.setUsername("root");
  63. ds.setPassword("root");
  64. return ds;
  65. }
Add Comment
Please, Sign In to add comment