Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Error executing sql statement

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I switched my jdbc driver from type 2 to type 4, right now i m using microsoft sql server jdbc driver of type 4. so as i generate any report in my application it throws error like: net.sf.jasperreports.engine.JRException: Error executing SQL statement for : DataSummaryReport_2

I am using stored procedure to retrieve data like: exec wdcGetDataSummaryData $P{SerialNumberStr},$P{Date}

I have migrated from jdk1.4 to 1.6.

can you please help me to solve my problem.
thanks in advance..
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That statment is not valid transact SQL. I'm assuming this is how you bound variables using the old driver? Try binding using ?, e.g.:

and using setString and setDate accordingly.,
 
gunjaan titiyaa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanks for the reply. i have used exec wdcGetDataSummaryData $P{SerialNumberStr},$P{Date} in my jrxml file, while using ireport. and passing parameter as input from database. in java code i used exec wdcGetDataSummaryData ?,?... and i got exception at a time of filling report on line:
JasperPrint jp =
JasperFillManager.fillReport
(jasperMain, parameters, connection);
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what SQL is executed for DataSummaryReport_2 ?
 
gunjaan titiyaa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It Is calling stored procedure retriving data from database for the report and stored in temp table. once report is generated temp table is deleted. but here i am not able to generate report itself and getting exception related to statement. i am also facing problem that from where it is giving error
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is the SQL for DataSummaryReport_2? The error message is telling you that there is something wrong with it.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

gunjaan titiyaa wrote:Hi,
I switched my jdbc driver from type 2 to type 4, right now i m using microsoft sql server jdbc driver of type 4. so as i generate any report in my application it throws error like: net.sf.jasperreports.engine.JRException: Error executing SQL statement for : DataSummaryReport_2

I am using stored procedure to retrieve data like: exec wdcGetDataSummaryData $P{SerialNumberStr},$P{Date}

I have migrated from jdk1.4 to 1.6.

can you please help me to solve my problem.
thanks in advance..



Hi!

This problem occure when using mssqljdbc4 driver. Replace it at your jasper server to jtds ms sql drivet - all will work fine. Driver is here: http://sourceforge.net/projects/jtds/files/
 
Something about .... going for a swim. With this tiny ad ...
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!