Search code examples
phpsql-serverubuntujasper-reportsjasperstarter

JasperStarter and SQL Server error Could not find prepared statement with handle


We are trying to run iReport on our PHP web base application. We use Ubuntu Server with php5 and using laravel framework and

We are running SQL Server 2012 database.

After input this

jasperstarter myReport.jasper 
-f pdf 
-P parameter1=test 
-t generic 
-H <my databse server ip> 
-u <username>
-p <password>
-n <dbname>
--db-driver com.microsoft.sqlserver.jdbc.SQLServerDriver  
--db-url jdbc:sqlserver://<my databse server ip>:1433

we get an empty pdf and

We are receiving this error when i run sql Profiler:

the sql:

declare @p1 int
set @p1=1
exec sp_prepexec @p1 output,NULL,N'select top 10 * from mytable'
select @p1
exec sp_unprepare 1

the error:

Msg 8179, Level 16, State 6, Procedure sp_prepexec, Line 1
Could not find prepared statement with handle 1.

Solution

  • After days of suffer, now i have solve this problem.

    I don't know if i'm doing it wrong when i add the sqljdbc driver.

    I change the driver to jtds jdbc driver and it work like charm.

    Tq