This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error executing sql statement

 
gunjaan titiyaa
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..
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate 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
Eclipse IDE Hibernate 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
Eclipse IDE Hibernate 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.
 
Alexey Mitrov
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/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic