This tag <sql:dateParam> use to assign a value or supply a date and time on required place within the reference of <sql:query> and <sql:update>. 


In this Program we mention <sql:dateParam> tag that will be execute with the use <sql:query> and <sql:update>.This tag is will implemented the value on required place holder as date or time in database. For access on database we declare drivers or the attributes that are must for database calling. Here we made a database named ‘dbirth’ with a table named ‘d_birth’ . That has to store the updating values and other query like to insert value. At last all the tags have to be closed the output on web browser will be come in the tabular mode.


 <%@ page import="java.util.Date,java.text.*" %>

<%@ taglib uri="" prefix="c"%>

<%@ taglib uri="" prefix="sql"%>



<title>&lt;sql:dateParam&gt;In JSTL </title>



      <sql:setDataSource var="db" driver="com.mysql.jdbc.Driver"

      url="jdbc:mysql://localhost/dbirth" user="root" password="root"/>

      <%  Date DoB = new Date("1989/02/16");

        int sal = 18000;


       <sql:update dataSource="${db}" var="updt">

            UPDATE d_birth SET dob = ? WHERE salary = ?

             <sql:dateParam value="<%=DoB%>" type="DATE" />

             <sql:param value="<%=sal%>" />


       <sql:query var="dt" dataSource="${db}">

           select * from d_birth


       <table border="1">



           <td><b>Last Name</b></td>




            <c:forEach var="values" items="${dt.rows}">










</html>                                                              JSTL SQL <sql:dateParam> Tag

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.