on 01-04-2006 1:59 PM
Hi guys,
currently I am working on a small Java application monitoring several oracle databases and different hosts.
Before attempting to connect to a db I'd like to make that
1. the host is reachable and
2. the oracle listener is running.
Therefore I open a socket connection to port 1527. If I get an UnknownHostException the host is not reachable and if I get an IOException the listener is not running.
Unfortunately there's no way to realise that the socket connection was closed by the listener. well, it works if you stop the listener with "lsnrctl stop" but it doesn't if sou simply shutdown the host.
Therefore I'd like to implement some kind of AYT-command in my application. The application should send something to the listener which in return prompts the server to send a reply. If the application won't receive a reply in time the connection is broken.
So, which command (data) can be send to the listener in order to get an instant reply?
Thanks in advance,
ron
Hi Ronny,
After opening the connection normally I would try to register a connection/exception listener with the connection.
This should notify the listener implementation you have to write about any problems with the connection.
Enjoy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For Oracle, I always use this:
select sysdate from dual
That will return the system date from the Oracle server. This does require that you login to the server with username/password. I'm not aware of any way to only talk to the listener.
Ray
P.S. If helpful, please award points.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.