IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PostgreSQL Discussion :

[Débutant] The authentication type 5, java


Sujet :

PostgreSQL

  1. #1
    Membre habitué Avatar de agougeon
    Inscrit en
    Mai 2005
    Messages
    253
    Détails du profil
    Informations forums :
    Inscription : Mai 2005
    Messages : 253
    Points : 147
    Points
    147
    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/tutori...dbc/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 : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    user=adminbd
    password=adminbd
    url= jdbc:postgresql://localhost:5432/image
    driver=org.postgresql.Driver
    et voici mon code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 : : :

  2. #2
    Membre habitué Avatar de agougeon
    Inscrit en
    Mai 2005
    Messages
    253
    Détails du profil
    Informations forums :
    Inscription : Mai 2005
    Messages : 253
    Points : 147
    Points
    147
    Par défaut
    J'ai trouvé... j'avai mal configuré postgres :/

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Débutant] Création d'une application Java type EE
    Par klane dans le forum Général Java
    Réponses: 17
    Dernier message: 01/09/2011, 17h42
  2. Réponses: 1
    Dernier message: 06/12/2005, 09h22
  3. [Débutant] Changer le type d'une colonne
    Par david71 dans le forum MS SQL Server
    Réponses: 8
    Dernier message: 08/11/2005, 11h26
  4. [Débutant]Programmer un mobile en java
    Par Pill_S dans le forum Java ME
    Réponses: 3
    Dernier message: 28/05/2004, 13h06
  5. [débutant]ou mettre un fichier java pour une appli jsp?
    Par zozolh2 dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 11/05/2004, 15h20

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo