Re: [INTERFACES] JDBC driver and postgreSQL

From: Peter T Mount <pgint(at)maidast(dot)demon(dot)co(dot)uk>
To: Agus Mingtarja <mingtarja(at)hdz-ima(dot)rwth-aachen(dot)de>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] JDBC driver and postgreSQL
Date: 1998-05-07 05:54:43
Message-ID: Pine.LNX.3.95.980507065212.3542C-100000@retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Wed, 6 May 1998, Agus Mingtarja wrote:

> Hi All,
> i have postgresql 6.3.2 (Linux 2.0 debian) istalled, and i can make
> database now. My question ist:
> How can i install the JDBC driver? (i use JDK 1.1.5)

To install, put the postgresql.jar into your classpath.

There are instructions in the README, and in the FAQ

http://www.retep.org.uk/postgres

> Ist my programm below correct?

Looks ok, except drop the second : in the JDBC URL. It should only be
there if a non standard port number is also given

>
> ...
> try
> { Class.forName("postgresql.driver");
> // force loading of driver
> String url = "jdbc:postgresql://localhost/database";

String url = "jdbc:postgresql//localhost/database";

> String user = "nobody";
> String password = "password";
> Connection con = DriverManager.getConnection(url, user,
> password);
> Statement stmt = con.createStatement();
> ...
>
> that's all. Please give me a tip. Thank You for the tip!

--
Peter T Mount peter(at)retep(dot)org(dot)uk or petermount(at)earthling(dot)net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Constantin Teodorescu 1998-05-07 17:25:21 Precompiled libraries for PgAccess, Linux RedHat 5.0 i386 and PostgreSQL 6.3.2
Previous Message Peter T Mount 1998-05-07 05:51:25 Re: [INTERFACES] Java Transaction