Jump to content
Changes to the Jaspersoft community edition download ×

Report Query - SQL


Recommended Posts

By: Eric Mendes - ointocavel

Report Query - SQL

2002-05-28 12:55

Hello jasperWORLD!!!!!

 

Could you help me??

 

I ve got the report descrived bellow when i ve tried to run a jsp code like this:

 

parameters.put("datainicial", request.getParameter("datainicial");

parameters.put("datafinal", request.getParameter("datafinal");

parameters.put("codplano", request.getParameter("codplano");

 

The basic SQL select query (select * from clients) is working well, but when i ve tried to use external strings to compose my SQL query( i m trying to get few parameters from my html form) i ve got the error message bellow.

 

Do I have to convert these parameters that i m trying to get from the html page to the same format of the data base field????

 

Any suggestion will be welcome!!!

 

Thanx in advance... Eric

 

begining of error message:

Location: /Gdonto/jsp/relatoriosporplano.jsp

Internal Servlet Error:

 

javax.servlet.ServletException: Error executing report query : relatoriosporplano

 

select planos.nome as nomeplano, clientes.codcliente as codcliente ,clientes.nome as nomecliente, contratos.codcontrato as contrato, contratos.datacontrato as dataadmissao from contratos inner join clientes on contratos.codcliente = clientes.codcliente inner join planos on contratos.codplano=planos.codplano where planos.codplano=? and contratos.datacontrato between '?' and '?' order by clientes.nome

 

 

at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)

at jsp._0002fjsp_0002frelatoriosporplano_0002ejsprelatoriosporplano_jsp_12._jspService(_0002fjsp_0002frelatoriosporplano_0002ejsprelatoriosporplano_jsp_12.java:148)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)

at org.apache.tomcat.core.Handler.service(Handler.java:286)

at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)

at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)

at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

at java.lang.Thread.run(Thread.java:484)

 

Root cause:

Parameter index out of range.

at org.postgresql.jdbc1.PreparedStatement.set(PreparedStatement.java:597)

at org.postgresql.jdbc1.PreparedStatement.setString(PreparedStatement.java:277)

at dori.jasper.engine.JRQueryExecuter.executeQuery(JRQueryExecuter.java:171)

at dori.jasper.engine.JRQueryExecuter.executeQuery(JRQueryExecuter.java:68)

at dori.jasper.engine.JasperManager.fillReport(JasperManager.java:663)

at jsp._0002fjsp_0002frelatoriosporplano_0002ejsprelatoriosporplano_jsp_12._jspService(_0002fjsp_0002frelatoriosporplano_0002ejsprelatoriosporplano_jsp_12.java:115)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)

at org.apache.tomcat.core.Handler.service(Handler.java:286)

at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)

at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)

at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

at java.lang.Thread.run(Thread.java:484)

 

NESTED BY :

dori.jasper.engine.JRException: Error executing report query : relatoriosporplano

 

select planos.nome as nomeplano, clientes.codcliente as codcliente ,clientes.nome as nomecliente, contratos.codcontrato as contrato, contratos.datacontrato as dataadmissao from contratos inner join clientes on contratos.codcliente = clientes.codcliente inner join planos on contratos.codplano=planos.codplano where planos.codplano=? and contratos.datacontrato between '?' and '?' order by clientes.nome

 

 

at dori.jasper.engine.JRQueryExecuter.executeQuery(JRQueryExecuter.java:207)

at dori.jasper.engine.JRQueryExecuter.executeQuery(JRQueryExecuter.java:68)

at dori.jasper.engine.JasperManager.fillReport(JasperManager.java:663)

at jsp._0002fjsp_0002frelatoriosporplano_0002ejsprelatoriosporplano_jsp_12._jspService(_0002fjsp_0002frelatoriosporplano_0002ejsprelatoriosporplano_jsp_12.java:115)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)

at org.apache.tomcat.core.Handler.service(Handler.java:286)

at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)

at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)

at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

at java.lang.Thread.run(Thread.java:484)

 

 

 

 

 

By: Teodor Danciu - teodord

RE: Report Query - SQL

2002-05-28 23:33

 

Hi,

 

Remove the ' characters that you have put around the ? characters.

Just like you have done for the first parameter.

 

That should be it.

 

Good luck!

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...