File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
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: 32087

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]
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:
subject: Check Database is running / not