Using keep-alive: ORA-00933: SQL command not properly ended

牧云@^-^@ 提交于 2019-12-12 05:37:24

问题


I'd like to use squirrel-sqls keep-alive feature since my Oracle database connections get cut if they idle for too long. It's a self-explanatory feature - or so one would expect - and also covered on SO.

However, the obvious SELECT 1 FROM DUAL; does not cut it and results in this error:

2016-10-21 16:43:51,879 [Thread-4] INFO
    net.sourceforge.squirrel_sql.client.session.SessionConnectionKeepAlive
    - SessionConnectionKeepAlive (...) running SQL: SELECT 1 FROM DUAL;
2016-10-21 16:43:51,882 [Thread-4] ERROR 
    net.sourceforge.squirrel_sql.client.session.SessionConnectionKeepAlive 
    - run: unexpected exception while executing sql (SELECT 1 FROM DUAL;):
      ORA-00933: SQL command not properly ended
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
    (...)

What seems to be the problem here?


回答1:


The problem is the trailing semicolon. Once removed...

SELECT 1 FROM DUAL

...the keep-alive feature starts working as expected.



来源:https://stackoverflow.com/questions/40179795/using-keep-alive-ora-00933-sql-command-not-properly-ended

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!