Received: from noao.edu (root@noao.edu [140.252.1.54]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA71469 for ; Tue, 16 May 2000 14:19:36 -0400 (EDT) (envelope-from swampler@noao.edu) Received: from reynaud.tuc.noao.edu (reynaud.tuc.noao.edu [140.252.38.6]) by noao.edu (8.9.3/8.8.8/SAG-27Sep99) with ESMTP id LAA75307 for ; Tue, 16 May 2000 11:19:35 -0700 (MST) (envelope-from swampler@noao.edu) Received: from noao.edu by reynaud.tuc.noao.edu (8.9.1b+Sun/SMI-SVR4-SAG05) id LAA16586; Tue, 16 May 2000 11:19:35 -0700 (MST) Message-ID: <39219136.FC6A1C87@noao.edu> Date: Tue, 16 May 2000 11:19:34 -0700 From: Steve Wampler Organization: National Solar Observatory X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: postgres-interfaces Subject: Detecting presence of database through JDBC? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200005/9 Is there a way to determine whether or not a particular database exists programmatically throught JDBC? I was expecting an exception to be thrown if the DriverManager.getConnection(url, user, pwd) method cannot complete, but instead I get a "FATAL" error that doesn't seem to be catchable. (I'd like the program to automatically create a database if it doesn't yet exist and then populate it with the tables that are needed. Handling the tables is easy, but I haven't found a way around the test for the database yet...) Thanks for any help! Steve -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu