Advertisement
Guest User

Untitled

a guest
Oct 17th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <%@ page import="java.io.*,java.util.*,java.sql.*"%>
  2. <%@ page import="javax.servlet.http.*,javax.servlet.*" %>
  3. <%--
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  5. <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
  6. --%>
  7. <html>
  8. <head>
  9. <title>JINSERT Operation</title>
  10. </head>
  11. <body>
  12.  
  13. <sql:setDataSource var="snapshot" driver="org.h2.Driver"
  14. url="jdbc:h2:tcp://localhost/~/NetIDEa"
  15. user="" password=""/>
  16.  
  17.  
  18. <sql:update dataSource="${snapshot}" var="result">
  19. INSERT INTO UTILISATEUR VALUES ('root@hot, 'root', 'root', 12);
  20. </sql:update>
  21.  
  22. <sql:query dataSource="${snapshot}" var="result">
  23. SELECT * from UTILISATEUR;
  24. </sql:query>
  25.  
  26. <table border="1" width="100%">
  27. <tr>
  28. <th>Emp ID</th>
  29. <th>First Name</th>
  30. <th>Last Name</th>
  31. <th>Age</th>
  32. </tr>
  33. <c:forEach var="row" items="${result.rows}">
  34. <tr>
  35. <td><c:out value="${row.id}"/></td>
  36. <td><c:out value="${row.first}"/></td>
  37. <td><c:out value="${row.last}"/></td>
  38. <td><c:out value="${row.age}"/></td>
  39. </tr>
  40. </c:forEach>
  41. </table>
  42.  
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement