Bonjour j'aimerai me connecte a ma base de donnee .Voila la methode
public String driver="org.postgresql.Driver";
public static String database="postgres";
public static String host="localhost";
public static String user="postgres";
public static String passwd="football";
public static Connection dbh=null;
private void lookup(){
System.out.println("loading driver"+driver);
try{
Class.forName(driver);
}catch(ClassNotFoundException cnfe){
System.out.println("fail");
System.exit(1);
}
System.out.println("ok");
}
Mais il m'affiche toujours "fail" .Je me suis informer et j'ai conclu que j'ai peut être mal installer les drivers de l'extension JDBC pour postgres .
Je suis aller sur le site de postgres pour télécharger cette extension en rapport bien sur avec ma machine virtuel de java .http://jdbc.postgresql.org/download.html
Ou et comment puis je installer ces driver ? De plus j'aimerais savoir le version de ma machine virtuel (je ne suis pas sur)comment le savoir?
Merci beaucoup de votre aide.
Partager