java.sql.SQLException: exception while executing query


Solutions on the web

Solution icon of googlegroups
via Google Groups by kunal mahale, 9 months ago
exception while executing query

Solution icon of github
exception while executing query: java.lang.String cannot be cast to java.lang.Integer

Solution icon of googlegroups
via Google Groups by Sanjay Mhaske, 1 year ago
while executing SQL: SELECT EMP_ID, EMP_NAME,MGR_ID FROM OPTIQ_EMPLOYEE CONNECT BY EMP_ID = MGR_ID

Solution icon of web
error while executing SQL "select "empid" from "hr"."emps" -- select": parse failed: Lexical error at line 2, column 10. Encountered: <EOF> after : ""

Solution icon of github
error while executing SQL "select * from (select t2.brand from (select brand,count(1) from DEMO group by brand having count(1) >=2) t1 join (select brand from DEMO ) t2 on t1.brand = t2.brand group by t2.brand) t3 LIMIT 50000": null

Solution icon of apache
via Apache's JIRA Issue Tracker by Victoria Markman, 1 year ago
While closing connection

Stack trace

java.sql.SQLException: exception while executing query
	at net.hydromatic.avatica.Helper.createException(Helper.java:40)
	at net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:406)
	at net.hydromatic.avatica.AvaticaStatement.executeQueryInternal(AvaticaStatement.java:350)
	at net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:78)
	at net.hydromatic.optiq.impl.mongodb.TestOptiq.main(TestOptiq.java:592)
Caused by: java.lang.RuntimeException: while executing SQL [SELECT 
 "$f0",("NAME") "$f1"

 FROM (SELECT "t4"."$f0", "DEPT0"."NAME"

 FROM (SELECT "$f0"

 FROM (SELECT "EMP"."DEPT_ID" "$f0"

 FROM "PV_ADMIN"."EMP"

 LEFT JOIN (SELECT "$f0",("ID") "$f1"

 FROM (SELECT "t0"."$f0", "DEPT"."ID"

 FROM (SELECT "$f0"

 FROM (SELECT "DEPT_ID" "$f0"

 FROM "PV_ADMIN"."EMP") "t"

 GROUP BY "$f0") "t0"

 INNER JOIN "PV_ADMIN"."DEPT" ON "t0"."$f0" = "DEPT"."ID") "t1"

 GROUP BY "$f0") "t2" ON "EMP"."DEPT_ID" = "t2"."$f0") "t3"

 GROUP BY "$f0") "t4"

 INNER JOIN "PV_ADMIN"."DEPT" "DEPT0" ON "t4"."$f0" = "DEPT0"."ID") "t5"

 GROUP BY "$f0"]
	at net.hydromatic.optiq.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:144)
	at net.hydromatic.linq4j.EnumerableDefaults.toLookup_(EnumerableDefaults.java:1898)
	at net.hydromatic.linq4j.EnumerableDefaults.toLookup(EnumerableDefaults.java:1891)
	at net.hydromatic.linq4j.EnumerableDefaults.toLookup(EnumerableDefaults.java:1867)
	at net.hydromatic.linq4j.DefaultEnumerable.toLookup(DefaultEnumerable.java:663)
	at net.hydromatic.linq4j.EnumerableDefaults$5.enumerator(EnumerableDefaults.java:886)
	at Baz$11$1.<init>(Unknown Source)
	at Baz$11.enumerator(Unknown Source)
	at net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.enumerator(OptiqPrepare.java:262)
	at net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.createCursor(OptiqPrepare.java:230)
	at net.hydromatic.optiq.jdbc.MetaImpl.createCursor(MetaImpl.java:597)
	at net.hydromatic.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:162)
	at net.hydromatic.optiq.jdbc.OptiqResultSet.execute(OptiqResultSet.java:52)
	at net.hydromatic.optiq.jdbc.OptiqResultSet.execute(OptiqResultSet.java:29)
	at net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:404)
	... 3 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-00979: not a GROUP BY 
 expression
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
	at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:852)
	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)
	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1477)
	at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:392)
	at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
	at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
	at net.hydromatic.optiq.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:139)
	... 17 more

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

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
72 more bugmates