Solution: java.sql.SQLSyntaxErrorException ORA-00907: missing closing parenthesis

Problem Description:

The sql statement can be executed correctly in pl/sql, but an error java.sql.SQLSyntaxErrorException is reported in mybatis ORA-00907: missing closing bracket!

Solution:

Replace the "#" in the query condition with "$".

The reason is as follows: MyBatis sees #{} and thinks that you are assigning a value to a variable in sql, just like assigning a question mark in JDBC programming (automatically add single quotes before and after) It is not treated as multiple values, but as a large string, so the value cannot be queried)

            When MyBatis sees ${}, it will directly replace it with the value of the variable without any processing.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326125085&siteId=291194637