Tnsping of some sorts
Good evening everyone,
As part if my Java, I am connecting to a database and doing a few selects. Before I connect though, I would like to make sure that at the very least db is alive. How can I get it done?
I put up tnsping in the subject, but really any other way will do. Connecting to somethig that does not exist or is not responding seems to take too long - I want suggested approach to be following (if db alive - connect)
tnsping is oracle specific right. In general, it should be possible to try to open a TCP Socket to the host and socket the database service would be running on. When we do a manual socket by hand we would not be able to do anything with it, i mean unless we did the entire what ever the JDBC protocol driver API thing would expect. But the lack of ability to connect to the host network address and port could be helpful to indicate if the service was not running.