Results 1 to 2 of 2
  1. #1
    mac's Avatar
    mac is offline Member
    Join Date
    Dec 2009
    St. Petersburg, Russia
    Rep Power

    Default 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)

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Rep Power


    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.

Similar Threads

  1. Replies: 3
    Last Post: 01-26-2009, 01:20 AM
  2. Topological Sorts
    By Emily in forum Advanced Java
    Replies: 1
    Last Post: 04-03-2008, 05:39 PM
  3. Topological Sorts
    By Emily in forum New To Java
    Replies: 0
    Last Post: 03-27-2008, 01:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts