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 'manager_id = 1 CONNECT BY PRIOR emp_id = manager_id' at line 1 Error Code: 1064 Call: SELECT emp_id, name, salary FROM emp START WITH manager_id = ? CONNECT BY PRIOR emp_id = manager_id bind => [1 parameter bound] Query: ReadAllQuery(referenceClass=Employee sql="SELECT emp_id, name, salary FROM emp START WITH manager_id = ? CONNECT BY PRIOR emp_id = manager_id")

Coderanch | Himai Minh | 3 months ago
  1. 0

    Chapter 11 nativequeries example modification for MySQL users

    Coderanch | 3 months ago | Himai Minh
    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 'manager_id = 1 CONNECT BY PRIOR emp_id = manager_id' at line 1 Error Code: 1064 Call: SELECT emp_id, name, salary FROM emp START WITH manager_id = ? CONNECT BY PRIOR emp_id = manager_id bind => [1 parameter bound] Query: ReadAllQuery(referenceClass=Employee sql="SELECT emp_id, name, salary FROM emp START WITH manager_id = ? CONNECT BY PRIOR emp_id = manager_id")
  2. 0

    Unit Test Results.

    eclipse.org | 1 year ago
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. Error Code: 0 Call: SELECT t2.EMP_ID, t2.VERSION, t2.MANAGER_EMP_ID, t0.EMP_ID, t0.F_NAME, t0.L_NAME, t0.VERSION FROM CMP3_SALARY t3, CMP3_EMPLOYEE t2, CMP3_SALARY t1, CMP3_EMPLOYEE t0 WHERE ((((NOT ((t2.MANAGER_EMP_ID IS NULL)) AND NOT EXISTS (SELECT ? FROM CMP3_SALARY t5, CMP3_EMPLOYEE t4 WHERE ((t4.MANAGER_EMP_ID = t2.EMP_ID) AND (t5.EMP_ID = t4.EMP_ID))) ) AND (t0.DEPT_ID IS NULL)) AND (t3.EMP_ID = t2.EMP_ID)) AND ((t0.EMP_ID = t2.MANAGER_EMP_ID) AND (t1.EMP_ID = t0.EMP_ID))) bind => [1] Query: ReadAllQuery(referenceClass=Employee sql="SELECT t2.EMP_ID, t2.VERSION, t2.MANAGER_EMP_ID, t0.EMP_ID, t0.F_NAME, t0.L_NAME, t0.VERSION FROM CMP3_SALARY t3, CMP3_EMPLOYEE t2, CMP3_SALARY t1, CMP3_EMPLOYEE t0 WHERE ((((NOT ((t2.MANAGER_EMP_ID IS NULL)) AND NOT EXISTS (SELECT ? FROM CMP3_SALARY t5, CMP3_EMPLOYEE t4 WHERE ((t4.MANAGER_EMP_ID = t2.EMP_ID) AND (t5.EMP_ID = t4.EMP_ID))) ) AND (t0.DEPT_ID IS NULL)) AND (t3.EMP_ID = t2.EMP_ID)) AND ((t0.EMP_ID = t2.MANAGER_EMP_ID) AND (t1.EMP_ID = t0.EMP_ID)))") FetchGroup(){id, manager, version}

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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 'manager_id = 1 CONNECT BY PRIOR emp_id = manager_id' at line 1 Error Code: 1064 Call: SELECT emp_id, name, salary FROM emp START WITH manager_id = ? CONNECT BY PRIOR emp_id = manager_id bind => [1 parameter bound] Query: ReadAllQuery(referenceClass=Employee sql="SELECT emp_id, name, salary FROM emp START WITH manager_id = ? CONNECT BY PRIOR emp_id = manager_id")

      at org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException()
    2. EclipseLink (non-OSGi)
      QueryImpl.getDetailedException
      1. org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException(QueryImpl.java:378)
      1 frame