<p>I'm trying to get a postgres jdbc connection working in eclipse. It would be nice to use the Data Source Explorer, but for now I'm just trying to get a basic connection. What I have done so far is download the postgres JDBC connector. I then tried two different things. First, Preferences-> Data Management, I tried to add the postgres connector. Second, I added the jar to my project and tried to load the driver using Class.forName("org.postgresql.Driver"); but neither worked. Does anyone have any ideas?</p>

<p>Thanks,
   Charlie</p>

Here's one way to get PostgreSQL connectivity to your application:
Get an instance of
```
org.postgresql.ds.PGSimpleDataSource
```
Setup it with values matching to your database (see methods below)
Proceed using the DataSource as you would use any other, I'd assume at this point you'd be interested in the
```
DataSource.getConnection()
```
method.
The proprietary methods for configuring this particular DataSource are
```
setServerName()
```
,
```
setDatabaseName()
```
,
```
setUser()
```
and
```
setPassword()
```
.
I wouldn't recommend doing this for anything else than testing though and it's possible your problem lies in the way you're trying to get an instance of the object using
```
Class.forName()
```
There's almost a dozen different ways to get an instance of an object with subtle differences, I suggest Googling for it since it is a subject a lot of people have already written about all over the Internet.