Home Discussion Discuss: Retrieve data from database by using sql tag of JSTL SQL library

  • JSTLtangara September 8, 2011 at 11:22 AM

    Hi, I followed the above example but it's not working. Hope someone can advise what happened. Many thanks. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> <%@page language="java" import ="java.sql.*" %> <sql:setDataSource var="dataSource" driver="com.mysql.jdbc.Driver" <sql:query var="members" dataSource="${dataSource}" maxRow ="3"> Select *, GROUP_CONCAT(subject.subjectName SEPARATOR \", \") AS Subj from members LEFT JOIN subinter ON subinter.membersID = members.id LEFT JOIN subject ON subinter.subjectID = subject.id GROUP BY members.id"); </sql:query> <h5>Members Record</h5> <table border ="1" cellspacing="0" cellspacing="0" align="center" class="bordered"> <tr><td><b>Member No</b></td> <td><b>NRIC</b></td> <td><b>Name</b></td> <td><b>Email</b></td> <td><b>Address</b></td> <td><b>Subject</b></td> <c:forEach var="row" items="${tutors.rows}"> <tr> <td><c:out value="${row.ID}" /></td> <td><c:out value="${row.strMemberName}" /></td> <td><c:out value="${row.strNRICNO}" /></td> <td><c:out value="${row.strEmail}" /></td> <td><c:out value="${row.strAddress}" /></td> <td><c:out value="${row.Subj}" /></td> </c:forEach> </table> <% out.print("<td><a href=\"update.jsp?ID=" + ID + "\">Modify</a></td>");%> <% out.print("<td><a href=\"DeleteMember.jsp?ID=" + ID + "\">Delete</a></td>");%> <td> <%no++;%></td></tr> </table> tr> <td>Total Number of Members: <%=no - 1%> <br /> To return to login page : "<a href="login.jsp">Click here</a>"</td></tr> <br /> <tr> <td> To logout : "<a href="logout.jsp">Click here</a>"</td></tr> <br /> <br /> <td><a href="register.jsp">Click here to Register Member</a></td> </body> </html> The error I get is unterminated<sql:setDataSourcetag>

  • Include options for delete and editShubham July 7, 2012 at 11:09 PM

    Can anybody please provide the code for adding options for deleting and editing the records in respective rows such that if I click on delete or edit option then change is reflected in the table...............

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
JSTL

Execute database query by using sql tag of JSTL SQL library
Execute database query by using sql tag of JSTL SQL library... to create application that execute sql query given by user using JSTL SQL Library...;sql:setDataSource> : This tag is used to create data source 

JSTL

Retrieve data from database by using sql tag of JSTL SQL library
Retrieve data from database by using sql tag of JSTL SQL library... we will see how retrieve data from database using sql query given by user... for that data source. <sql:setDataSource> : This tag is used 

JSP Tutorials

JSP SQL Tag
sql tag in jsp.  JSTL?s database library supports database queries... to the database, we have used the jstl tag <sql:setDataSource> whose attributes... from JSP SQL Tag. To understand the example we will show you to use jstl tag 

JSTL

Insert data in database by using sql tag of JSTL SQL library
Insert data in database by using sql tag of JSTL SQL library... by user. To update database first create a data source and then execute insert sql...; <sql:setDataSource> : This tag is used to create data 

JSTL

Use of tag of jstl
Use of <sql:transaction> tag of jstl  ...:transaction> tag of jstl. To execute query and update database first create...; <sql:setDataSource> : This tag is used to create data source 

JSTL

JSTL Tutorials and Online Training
; Insert data in database by using sql tag of JSTL SQL library Here... retrieve data from database using sql query given by user. To execute query first... database query by using sql tag of JSTL SQL library Here in this section we 

SQL Question

SQL
SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database in the given format. For (15 march 2011) format: SELECT DATE_FORMAT(dob, '%d %M %Y') FROM 

SQL Question

SQL
SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database in the given format. For (15 march 2011) format: SELECT DATE_FORMAT(dob, '%d %M %Y') FROM 

Training

JSTL Training
; JSTL (JSP Standard Tag Library) allows the web developer to create powerful web... locale Database actions with the DBTags library How JSTL locates... actions Using the DBTags and Input tag libraries together to create data-bound 

JSTL

Overview of JSTL Tags
SQL (javax.servlet.jsp.jstl.sql) Common database tasks Tag Library... related tasks directly from within the JSP. The I/O tag library provides... will introduce you with all the tags provided by the JSTL library. The JSTL 1.1 API 

JSTL

JSTL XML Tags
such as: add, modify, remove and verify. In JSTL , we have a separate sql tag known... on JSTL,the author deals with the 'sql' tags in JSTL  and shows how..., it is much more direct to provide for data access by the JSP itself, but using 

Java Beginners

Transfer Data to Sql Database
Transfer Data to Sql Database  Hey guys, how to Transfer data to SQl database using Java? Transfer data already stored in excel to Sql databse using Java? Looking for an easier method so i can comprehend 

JSP Tutorials

AN INTRODUCTION TO JSTL
-Standard Tag Library (JSTL) project.  Though there are a number of popular... tag-based language, using which page-authors can turn into programmers overnight... on using ColdFusion for typical web-based database operations, elsewhere 

XML Questions

JSTL- xml tag library - XML
JSTL- xml tag library  i was trying to try jstl-xml tags examples that were given on your site on the following url "http://www.roseindia.net/jstl... encountered an internal error () that prevented it from fulfilling this request 

SQL Question

delete data from database - SQL
delete data from database  HOw to delete specific data from table> I want to delete one record from database. Thnx  Hi friend, -------------------------------------------- Visit for more information 

SQL Question

sql - SQL
(select,insert,update etc.), manipulate objects(DDL) and data(DML). PL/SQL.... 2 SQL tells the database what to do (declarative) while PL/SQL tell the database how to do things (procedural). 3 SQL is used to code queries, DML 

JSTL

JSTL Tutorial
encoding. JSTL SQL Tags JSTL SQL Tags are useful to manipulate the database data.... according to their localization. The JSTL format tag library provides many...; Followings are the commonly used tags of JSTL format tag library : <fmt 

SQL Question

fetching data using servlets - SQL
for fetching data from a ORACLE10g database using SERVLETS.   Hi Friend...fetching data using servlets  I have successfully made connection with the oracle10g database that i am using and also able to put in data using JSP 

SQL Question

Inserting Data into mysql - SQL
into the SQL category though under php. I need help with reading from a csv file (using php)and inserting the details in a mysql database. Lets take for instance...Inserting Data into mysql  My sincere apologize for this post. I 

JSP Tutorials

What is a Tag Library in JSP
What is a Tag Library in JSP   ... explanation of the Tag Library in JSP. In the Java Server Pages Technology, multiple actions are accessed by using the tags of the JSP whether the tag is standard 

SQL Question

SQL or UNICODE - SQL
to display is fetched from the database which is connected using DSNless connection... that........... i was using MS Access as the database with my JAVA Japplet..., In Access database, declare the data type 'Text' to both the fields. You can use 

JSP Interview Questions

JSTL
JSTL  How to remove element from list one by one in jsp using jstl tag? My requirement is, i want to remove a element from selectlist, that element should not appear in the next followed select list, which is hided 

SQL Question

database - SQL
everyday 1 question as "Question of the day" from database. It should not change till the end of the day. Next day it should display another question. i am using 

SQL Question

output using SQL
output using SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database... %M %Y') FROM patient; For (15/03/2011) format: SELECT DATE_FORMAT(dob, '%d/%m 

JSTL

Introduction to the JSTL
;  JSP Standard Tag Library or JSTL for short.... JSTL are the jsp tag libraries released by SUN to ease the JSP programming... that they can easily access and manipulate the application data without using 

SQL Tutorial

SQL _ Wildcards
from data in a database. The SQL wildcards substitute one or more character, whenever there is a search for data in a table of the database...; The Tutorial illustrate an example from SQL_Wildcards 

Quartz Tutorials

SQL _ Wildcards
from data in a database. The SQL wildcards substitute one or more character, whenever there is a search for data in a table of the database...; The Tutorial illustrate an example from SQL_Wildcards 

SQL Question

SQL
SQL Trigger query  Why we use the Trigger and what it's uses?   A database trigger is procedural code that is automatically executed in response to certain events on a particular table in a database. Triggers can 

SQL Question

SQL
?   A database trigger is procedural code that is automatically executed in response to certain events on a particular table in a database. Triggers can restrict access to specific data, perform logging, or audit data modifications 

SQL Question

SQL
?   A database trigger is procedural code that is automatically executed in response to certain events on a particular table in a database. Triggers can restrict access to specific data, perform logging, or audit data modifications 

DMCA.com