Skip site navigation (1) Skip section navigation (2)

Re: newbie: retep wants to have username?

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Mirko Zeibig <mirko(at)picard(dot)inka(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: newbie: retep wants to have username?
Date: 2001-02-16 16:11:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Quoting Mirko Zeibig <mirko(at)picard(dot)inka(dot)de>:

> Hello everybody,
> I am not that deep in Java, just playing a bit with it, using PG7.1beta
> from
> CVS on RedHat 7.0. Going to contrib/retep/jars I tried:
> [mirko(at)romulan jars]$ java -cp ./retepTools.jar \
> \
> -Dorg.postgresql.Driver \
> -Jjdbc:postgresql:mirko/mirko
> Now using JDBC Driver: org.postgresql.Driver
> The user property is missing. It is mandatory.

Yes, its asking for the postgresql username.

There's three ways of supplying it.

1: use: .getConnection(url,user,password);
2: use: .getConnection(url) with user/password in the url
3: use: .getConnection(url,props) where props is a Properties with the 
user/password in it.

for 2 use: jdbc:postgresql:db?user=PETER&password=SECRET

for 3 have properties called user & password

(internally the driver converts them into Properties anyhow ;-) )

> to get a dump of the database. It is a bit of a pity that examples
> exposed when invoked without parameters are all about oracle :-).

Oracle can be a bit lax with security at times ;-)

> I tried jdbc:postgresql:mirko/mirko(at)localhost for -J as well, same

Nope. There is no actual url standard (other than jdbc:subprotocol:).

Try: jdbc:postgresql:mirko?user=mirko (localhost is optional or)

> result. I
> do not see where the jdbc-url is parsed, I guess somewhere in the
> pgsql-driver? Is it possible to use a url with user/db(at)host with
> PostgreSQL
> at all?
> I studied the jdbc-interface documentation and did not see this syntax
> mentioned anywhere.

Doesn't exist ;-)


Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver:
RetepPDF PDF library for Java:

In response to


pgsql-jdbc by date

Next:From: Corey MosherDate: 2001-02-16 18:08:55
Subject: Re: Trouble With JDBC
Previous:From: Corey MosherDate: 2001-02-16 15:57:05
Subject: Re: Trouble With JDBC

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group