aspose file tools*
The moose likes JDBC and the fly likes Check Database is running / not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Check Database is running / not" Watch "Check Database is running / not" New topic
Author

Check Database is running / not

SonalPSPL Bagmar
Greenhorn

Joined: Jul 29, 2004
Posts: 22
Hi All
i want to check through java code whether my oracle database on the server machine (solaris platform) is up and running.
How can i do that? any hints / ideas....


Regards
SONAL
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

send a 'select sysdate from dual' and check the response.


http://home.arcor.de/hirnstrom/bewerbung
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30512
    
150

Do you want to know if the database as a whole is running or a particular instance?

Either way, you would do a query. But the specific query would vary. Also note that you are checking the query doesn't throw an exception. Not a specific return value.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Check Database is running / not