使用保持活动状态:ORA-00933:SQL命令未正确结束 [英] Using keep-alive: ORA-00933: SQL command not properly ended

查看:169
本文介绍了使用保持活动状态:ORA-00933:SQL命令未正确结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用squirrel-sql的保持活动功能,因为如果我的Oracle数据库连接闲置时间过长,它们会被切断.这是一项不言自明的功能-也许有人会期望-并且包含在SO上.

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.

但是,明显的SELECT 1 FROM DUAL;不能剪切并导致此错误:

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)
    (...)

这里似乎是什么问题?

推荐答案

问题是结尾的分号.一旦删除...

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

SELECT 1 FROM DUAL

...保持活动功能按预期开始工作.

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

这篇关于使用保持活动状态:ORA-00933:SQL命令未正确结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆