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: 982339918.3a8d514ea07e0@webmail.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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 \
> uk.org.retep.xml.test.XMLExport \
> -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)
jdbc:postgresql://localhost/mirko?user=mirko

> 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

--
Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

In response to

Responses

Browse pgsql-jdbc by date

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