Which library can be used to interact with database in JSP?


The JSTL SQL tag library provides tags for interacting with relational databases (RDBMSs) such as Oracle, MySQL, or Microsoft SQL Server.

Following is the syntax to include JSTL SQL library in your JSP −

<%@ taglib prefix = "sql" uri = "http://java.sun.com/jsp/jstl/sql" %>

Following table lists out the SQL JSTL Tags −

S.No.Tag & Description
1<sql:setDataSource>Creates a simple DataSource suitable only for prototyping
2<sql:query>Executes the SQL query defined in its body or through the sql attribute.
3<sql:update>Executes the SQL update defined in its body or through the sql attribute.
4<sql:param>Sets a parameter in an SQL statement to the specified value.
5<sql:dateParam>Sets a parameter in an SQL statement to the specified java.util.Date value.
6<sql:transaction >Provides nested database action elements with a shared Connection, set up to execute all statements as one transaction.

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 30-Jul-2019

134 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements