I don't know if this is the right place for my question, if this is not, please redirect me to the right one.
From some place in the web i copied the stuff to connect to Mysql using a DataSource and tried to adapt to my application.
It doesn't work.
I am using Tomcat 9.0.10, Mysql 5.7.
The problem is i am receiving 2 errors and i think they are the result of a bad connection.
Here are the errors:
25-Aug-2018 06:30:22.756 SEVERE [http-nio-8080-exec-7] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for
servlet [
jsp] in context with path [/agenda] threw exception [Unable to compile class for JSP:
An error occurred at line: [17] in the jsp file: [/validate.jsp]
rsAgenda cannot be resolved
14: <sql:param value = "${password}" />
15: </sql:query>
16:
17: <% if (rsAgenda.size() != 1) { %>
18: <ora:redirect page="login.jsp" >
19: <ora:param name="errorMsg" value="Clave de Usuario y/ Password son invalidos" />
20: </ora:redirect>
An error occurred at line: [25] in the jsp file: [/validate.jsp]
rsAgenda cannot be resolved
22: <%--
23: Crea una userJavaBean y la guarda en session scope.
24: --%>
25: <% Row oneRow = (Row) rsAgenda.firstElement(); %>
26: <jsp:useBean id="validUser" scope="session" class="com.ora.jsp.userJavaBean" >
27: <jsp:setProperty name="validUser" property="usuario" value='<%= oneRow.getString("usuario") %>' />
28: <jsp:setProperty name="validUser" property="password" value='<%= oneRow.getString("password") %>' />
Stacktrace:] with root cause
org.apache.jasper.JasperException: Unable to compile class for JSP:
And here is the validate.jsp program:
The context.xml:[/u]
<Resource name="jdbc/Mysql1" auth="Container" type="javax.sql.DataSource"
maxTotal="100" maxIdle="30" maxWaitMillis="10000"
username="root" password="root" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/javatest?serverTimezone=UTC&useLegacyDatetimeCode=false&time_zone='+00:00'"/>
[
b]The web.xml:[/b]
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<description>MySQL Agenda App</description>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/Mysql1</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
Any ideas?
Any help is welcome.
Sincerely,
Rafael