The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "Check Database is running / not" Watch "Check Database is running / not" New topic

Check Database is running / not

SonalPSPL Bagmar

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

Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

send a 'select sysdate from dual' and check the response.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32807

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Check Database is running / not
It's not a secret anymore!