pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Olarte <olarte.andres@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: I just can't use the org.postgresql.Driver class... Please help!
Date: Mon, 10 Apr 2006 19:51:15 -0600
Message-ID: <3fccaa690604101851t50f291cak23c2cee3cf3b59ba@mail.gmail.com> (raw)
In-Reply-To: <CC1CF380F4D70844B01D45982E671B230137A842@mtxexch01.add0.masergy.com>
References: <AcZY4mzA3RUJq+ZJSeC0K8WDXCb86wAFeEhA>
	<CC1CF380F4D70844B01D45982E671B230137A842@mtxexch01.add0.masergy.com>

You must catch an Exception that *might* be thrown, in this case it's
ClassNotFoundException.

Change:

public static void main(String[] args)
  {

  Class.forName("org.postgresql.Driver");

  }

to

public static void main(String[] args)
  {
try {
  Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException e ){
}

  }


This way it'll compile.  This has nothing to do with JDBC, this is
basic Java stuff.



view thread (4+ messages)

Message-ID: <3fccaa690604101851t50f291cak23c2cee3cf3b59ba@mail.gmail.com>
Permalink:  ../3fccaa690604101851t50f291cak23c2cee3cf3b59ba@mail.gmail.com/
Also on:    postgresql.org/message-id/3fccaa690604101851t50f291cak23c2cee3cf3b59ba@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: olarte.andres@gmail.com
  Subject: Re: I just can't use the org.postgresql.Driver class... Please help!
  In-Reply-To: <3fccaa690604101851t50f291cak23c2cee3cf3b59ba@mail.gmail.com>
  References: <AcZY4mzA3RUJq+ZJSeC0K8WDXCb86wAFeEhA> <CC1CF380F4D70844B01D45982E671B230137A842@mtxexch01.add0.masergy.com> <3fccaa690604101851t50f291cak23c2cee3cf3b59ba@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox