pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roland Walter <rwa@mosaic-ag.com>
To: david@eclipsecat.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Any example code of using passwords with JDBC?
Date: Tue, 14 Jun 2005 17:38:32 +0200
Message-ID: <42AEF9F8.1060608@mosaic-ag.com> (raw)
In-Reply-To: <42AEF2A5.2050107@eclipsecat.com>
References: <42AEF2A5.2050107@eclipsecat.com>

David Siebert schrieb:

> I have yet to figure out how to access a postgres server that requires 
> passwords. I can log onto it with PG adminIII just fine but not using JDBC.
> Here is my connect statement
>  m_sqlConnection = DriverManager.getConnection(s_SQLConnect, 
> s_SQLUser,"PASSWORD");
> I have tried clear text, md5, and encrypted.
> Does JDBC detect what type of password is required and then sends it?
> Or do I have to specify it somewhere?

I use md5 in pg_hba.conf.

The JDBC-Driver seems to know, what to send, as I use only
the statement you have given above to get a connection.

Creating a user with

CREATE USER user1 WITH PASSWORD 'secret';

gives a user1 with an encrypted password, that is
md5 encrypted by default.


-- 
Roland Walter
MOSAIC SOFTWARE AG
Telefon: 02225/882-411 Fax: 02225/882-201
http://www.mosaic-ag.com
-------  L E G A L    D I S C L A I M E R  ---------

Die Informationen in dieser Nachricht sind vertraulich 
und ausschliesslich fuer den Adressaten bestimmt. 
Kenntnisnahme durch Dritte ist unzulaessig. Die 
Erstellung von Kopien oder das Weiterleiten an weitere, 
nicht originaere und benannte Adressaten ist nicht 
vorgesehen und kann ungesetzlich sein. Die Meinungen 
in dieser Nachricht stellen lediglich die Meinungen 
des Senders dar. Falls Sie vermuten, dass diese 
Nachricht veraendert wurde, setzen Sie sich mit dem 
Absender in Verbindung. Der Absender uebernimmt ohne 
weitere Ueberpruefung keine Verantwortung fuer die 
Richtigkeit und Vollstaendigkeit des Inhalts. Unbefugte 
Empfaenger werden gebeten, die Vertraulichkeit der 
Nachricht zu wahren und den Absender sofort ueber 
einen Uebertragungsfehler zu informieren.
------------------------------------------------------




view thread (3+ messages)

Message-ID: <42AEF9F8.1060608@mosaic-ag.com>
Permalink:  ../42AEF9F8.1060608@mosaic-ag.com/
Also on:    postgresql.org/message-id/42AEF9F8.1060608@mosaic-ag.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: rwa@mosaic-ag.com, david@eclipsecat.com
  Subject: Re: Any example code of using passwords with JDBC?
  In-Reply-To: <42AEF9F8.1060608@mosaic-ag.com>
  References: <42AEF2A5.2050107@eclipsecat.com> <42AEF9F8.1060608@mosaic-ag.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