Hi folks,
We are trying to display data from HANA using jstl inside a simple jsp page. The jsp is executed via Apache Tomcat 7. We have included the required jars(jstl and HANA JDBC driver) under the lib folder of the project's WEB-INF directory.
Here is the code for the task-
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@page import="java.sql.*" %>
<sql:setDataSource
driver = "com.sap.db.jdbc.Driver"
url = "jdbc:sap://[servername:portnumber]?reconnect=true"
user = "xyz"
password = "passwd" />
<sql:query var="results">
SELECT DISTINCT TEXT FROM "TestHana"."HanaTest"
</sql:query>
<!doctype html>
<html>
<body>
This is the list of results:
<ul>
<c:forEach var="row" items="${results.rowsByIndex}">
<li><c:out value="${row[0]}" /> </li>
</c:forEach>
</ul>
</body>
</html>
However the output that we get on the jsp page is this -
This is the list of results:
- ${row[0]}
Please advise how we can resolve this. Thanks in advance!
Cheers,
Junaid