Why I obtain this “SQLSyntaxErrorException: ORA-00933: SQL command not properly ended” when I try to perform this JDBC query?

前端 未结 2 1995
北荒
北荒 2020-12-21 04:07

I have some problem trying to implement a simple JDBC query into a Java application.

So I have the following query:

SELECT   D.*
FROM   coda_tx c, do         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-21 04:56

    executeQuery() automatically adds a semicolon to a statement when executing it.

    Change the line sb.append("';"); to sb.append("'");.

    Also you'll need to add spaces at the end or at the beginning of each line, your statements are invalid otherwise.

提交回复
热议问题