问题
I'd like to use squirrel-sql
s 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