Good day guys,
anyone here who knows how to easily access image pointers stored in a database in JSP?...
here's my code =) ... it already works in retrieving data other than the image...
my database contains petid, petname,birthdate,image,petprice....
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<sql:setDataSource driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/store"
user="root"/>
<sql:query var="result" sql="SELECT petid, petname,birthdate,image,petprice FROM pets"/>
<c:choose>
<c:when test="${result.rowCount == 0}">
<p> no more to display! </p>
</c:when>
<c:otherwise>
<table id="mainTable">
<c:forEach var="row" items="${result.rows}">
<tr>
<td><h5><c:out value="${row.petid}"/></h5></td>
<td><h5><c:out value="${row.petname}"/></h5></td>
<td><h5><c:out value="${row.birthdate}"/></h5></td>
<td><h5><c:out value="${row.image}"/></h5></td>
<td><h5><c:out value="${row.petprice}"/></h5></td>
</tr>
</c:forEach>
</table>
</c:otherwise>
</c:choose>