Error

0

Hi I am getting below error. Please advise to resolve it. Thank you!

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: Error executing SQL statement for: closedpos.
    at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:536)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$17(ReportController.java:511)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:429)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: net.sf.jasperreports.engine.JRException: Error executing SQL statement for: closedpos.
    at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:347)
    at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1257)
    at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:726)
    at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:456)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:578)
    at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.PAYMENT,
SUM(PAYMENTS.TOTAL),
 AS TOTAL
FROM CLOSEDCASH, PAYMENTS, RECEIPTS, TA' at line 9
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
    at com.mysql.jdbc.Util.getInstance(Util.java:387)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:942)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1962)
    at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:310)
    ... 6 more
 

disha.patel's picture
Joined: Nov 27 2018 - 8:53am
Last seen: 2 days 14 hours ago

Thank you Hozawa.

I removed error .  I am getting other error as below now

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: Error executing SQL statement for: customers_list.
    at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:536)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$17(ReportController.java:511)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:429)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: net.sf.jasperreports.engine.JRException: Error executing SQL statement for: customers_list.
    at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:347)
    at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1257)
    at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:726)
    at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:456)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:578)
    at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'unicentaopos.CUSTOMERS' doesn't exist
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
    at com.mysql.jdbc.Util.getInstance(Util.java:387)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:942)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1962)
    at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:310)
    ... 6 more
 

disha.patel - 3 days 20 hours ago

You still have an SQL Query error.  The 'caused by' lines tell you whats wrong.

"Table 'unicentaopos.CUSTOMERS' doesn't exist"

 

djohnson53 - 3 days 18 hours ago

SELECT
CLOSEDCASH.HOST,
CLOSEDCASH.HOSTSEQUENCE,
CLOSEDCASH.MONEY,
CLOSEDCASH.DATESTART,
CLOSEDCASH.DATEEND,
PAYMENTS.PAYMENT,
SUM(PAYMENTS.TOTAL) AS TOTAL
FROM CLOSEDCASH, PAYMENTS
WHERE CLOSEDCASH.MONEY = PAYMENTS.MONEY
GROUP BY CLOSEDCASH.HOST, CLOSEDCASH.MONEY, CLOSEDCASH.DATESTART, CLOSEDCASH.DATEEND, PAYMENTS.PAYMENT
ORDER BY CLOSEDCASH.HOST, CLOSEDCASH.DATESTART

 

Here is my query if I can get help with it.  I don't know why it is saying  unicentaopos.CLOSEDCASH' doesn't exist. I have that table in my database. Please advise. Thank you!

disha.patel - 3 days 18 hours ago

1 Answer:

1

You have an error in your SQL statement.

hozawa's picture
34020
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 hours 37 min ago
Feedback
randomness