Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
- <%@page import="java.sql.*"%>
- <%@page import="java.io.*"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>JSTL UPDATE TAG</title>
- </head>
- <body>
- <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
- url="jdbc:mysql://localhost:3306/firoz" user="root" password="system" />
- <sql:update dataSource="${snapshot }" var="cont" sql="insert into mvc values (69,'dfds','dfdfsd')">
- </sql:update>
- <sql:query dataSource="${snapshot}" var="res">
- select * from mvc;
- </sql:query>
- <table border="2" width="100%">
- <tr>
- <th>UserId</th>
- <th>UserName</th>
- <th>Password</th>
- </tr>
- <c:forEach var="row " items="${res.rows}">
- <tr>
- <td><c:out value="${row.UserId}"></c:out></td>
- <td><c:out value="${row.Password}"></c:out></td>
- <td><c:out value="${row.UserName}"></c:out></td>
- </tr>
- </c:forEach>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement