java.sql.SQLException

The SET SHOWPLAN statements must be the only statements in the batch. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628) at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:525) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:487) at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:664) at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1114)

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Stack trace

  • java.sql.SQLException: The SET SHOWPLAN statements must be the only statements in the batch. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628) at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:525) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:487) at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:664) at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1114) at SQLSample.getQueryCost(SQLSample.java:4225) at SQLSample.MSSQL_plan_statement(SQLSample.java:4160) at SQLSample.body(SQLSample.java:480) at com.cas.Module.exec(Module.java:1260) at SQLSample.main(SQLSample.java:564)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

We couldn't find other users who have seen this exception.