title: Access a Derby database from JSP
body: <p>My question is in the title. I am new to Java web development and I am currently working on an assignment that requires the use of only JSP, Derby and Tomcat (servlet, scripting languages, beans and frameworks are banned). I have created a Derby database which is located in D:\Software\Apache\derby\db-derby-10.10.1.1-bin\lib\databases, and the content of my JSP file is as follows:</p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%&gt;
  &lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
          &lt;title&gt;Testing&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;p&gt;Testing Java: &lt;% out.print("Welcome to Ninja Loot"); %&gt;!&lt;/p&gt;
  
          &lt;sql:setDataSource url="jdbc:derby:D:\Software\Apache\derby\db-derby-10.10.1.1-bin\lib\databases\mydb" var="mydb" driver="org.apache.derby.jdbc.EmbeddedDriver"/&gt;
          &lt;sql:query dataSource="${mydb}" var="result"&gt;
              SELECT * FROM PEOPLE;
          &lt;/sql:query&gt;
          &lt;table border="1" width="100%"&gt;
              &lt;tr&gt;
                  &lt;th&gt;Forename&lt;/th&gt;
                  &lt;th&gt;Surname&lt;/th&gt;
              &lt;/tr&gt;
              &lt;c:forEach var="row" items="${result.rows}"&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;c:out value="${row.Forename}"/&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;c:out value="${row.Surname}"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;/c:forEach&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>however, the following line throws an exception saying "org.apache.jasper.JasperException: An exception occurred processing JSP page /test.jsp at line 14" and I cannot figure out why. </p>
  
  <pre><code>&lt;sql:setDataSource url="jdbc:derby:D:\Software\Apache\derby\db-derby-10.10.1.1-bin\lib\databases\mydb" var="mydb" driver="org.apache.derby.jdbc.EmbeddedDriver"/&gt;
  </code></pre>
  
  <p>Stacktrace: 
  org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe‌​r.java:568) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347) javax.servlet.http.HttpServlet.service(HttpServlet.java:725) </p>
  
  <p>Could someone please point out what is wrong in my code? Many thanks in advance!</p>