I'm trying to get a simple query returned on a JSP with very limited data, say about 20-25 rows max being returned.
I am somewhat new to using JSTL but I was wondering in the JSP with the tags, does something like var="{time_req_date}" replace the scriptlet, or request.getParamter variable, for example?
<c:set var="time_req1" value="<=${time_req_date}>"/>
<c:set var="time_req2" value="<=${time_req_date2}>"/>
<sql:query var="sqlresult" sql="select * FROM FORM_REDUCVU WHERE
to_date(TIME_REQ,'mm/dd/yyyy') >= ? AND to_date(TIME_REQ,'mm/dd/yyyy')
<= ? ORDER BY ID DESC" maxRows="25" dataSource="jdbc/myoracledev">
<sql:param value="1110484" ></sql:param>
</sql:query>
I've got two text fields from a search form page and I'm just trying to get that data returned. I wasn't even sure if I was going to need to use the format tag lib for the date. Maybe I am, but if you can point me in the proper direction I'd appreciate it. I realize this data normally shouldn't go in the JSP and I am working on building a separate DAO class to compartmentalize that code. Just for the short term I'd like to know what is missing or incorrect.
Errors seemed to imply the following:
18-Feb-2019 11:57:32.502 SEVERE [http-nio-20000-exec-6]
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service()
for servlet [jsp] in context with path [/useragent] threw exception
[javax.servlet.ServletException: javax.servlet.jsp.JspException: select
* FROM FORM_REDUCVU WHERE to_date(TIME_REQ,'mm/dd/yyyy') >= ? AND
to_date(TIME_REQ,'mm/dd/yyyy') <= ? ORDER BY ID DESC: Missing IN or
OUT parameter at index:: 2] with root cause
java.sql.SQLException: Missing IN or OUT parameter at index:: 2
Thanks!