Précédent   Forum des professionnels en informatique > Bases de données > PostgreSQL
PostgreSQL Forum PostgreSQL. Avant de poster -> F.A.Q PostGreSQL Tutoriels PostGreSQL
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 06/05/2005, 19h32   #1
Membre habitué
 
Avatar de agougeon
 
Inscription : mai 2005
Messages : 253
Détails du profil
Informations forums :
Inscription : mai 2005
Messages : 253
Points : 106
Points : 106
Par défaut [Débutant] The authentication type 5, java

Bonjour a tous,
Voila j'ai un petit probleme d'execution sous java avec la JDBC, voici le plan :
J'ai voulu suivre le tuto
http://ricky81.developpez.com/tutoriel/java/jdbc/blob/#L2.2

J'ai lancer postgres sous windows avec pgAdminIII, j'ai créer une base "image" et voici mes fichiers

Mon fichier de conf : proprietePostgresqlBLOB.dat

Code :
1
2
3
4
5
 
user=adminbd
password=adminbd
url= jdbc:postgresql://localhost:5432/image
driver=org.postgresql.Driver
et voici mon code :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
import java.sql.*;
import java.util.*;
import java.io.*;
public class Driver {
 
	  private Connection conn;
 
	  public Driver()
	  {
	  }
 
	  public void initialiserConnexion(String fichierConfig) throws Exception
	  {
	    Properties propBD = new Properties();
 
	    try
	    {
	      FileInputStream entree = new FileInputStream(fichierConfig);
	      propBD.LOAD(entree);
	    }catch(IOException e){
	    	e.printStackTrace();
	    }
 
	    Class.forName(propBD.getProperty("driver"));
	    conn = DriverManager.getConnection(propBD.getProperty("url"),
	    propBD.getProperty("user"),propBD.getProperty("password"));
	  }
 
	  public void deconnexion() throws Exception
	  {
	    IF(conn != NULL)
	    {
	      conn.close();
	    }
	  }
 
	  public static void main(String[] args) throws Exception{
	  	Driver driver = new Driver();
	  	driver.initialiserConnexion("proprietePostgresqlBLOB.dat");
	  }
 
}
et Voici mon erreur
Code :
1
2
3
4
5
6
7
8
 
Exception IN thread "main" The authentication type 5 IS NOT supported. CHECK that you have configured the pg_hba.conf file TO include the clients IP address OR Subnet, AND that it IS USING an authentication scheme supported BY the driver.
	at org.postgresql.Connection.openConnection(Connection.java:204)
	at org.postgresql.Driver.connect(Driver.java:116)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at Driver.initialiserConnexion(Driver.java:40)
	at Driver.main(Driver.java:53)

Une personne en aide : : :
agougeon est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 07/05/2005, 14h01   #2
Membre habitué
 
Avatar de agougeon
 
Inscription : mai 2005
Messages : 253
Détails du profil
Informations forums :
Inscription : mai 2005
Messages : 253
Points : 106
Points : 106
J'ai trouvé... j'avai mal configuré postgres :/
agougeon est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 16h28.


 
 
 
 
Partenaires

Hébergement Web