Mysql java jdbc driver
niki
-
niki -
niki -
Bonjour,
jai une bd mysql 5.5
pilote jdbc 5.1.16 sous forme de jar que jai ajoutera ma librairie ( java build path du projet)
jre 1.6
je travaille sous eclipse
voici mon code, le driver se charge mai jarrive pa a acceder a la base ! je suis perdue :!
String pilote = "com.mysql.jdbc.Driver";
try{
Class.forName(pilote);
try{
Connection connexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/mail","root","sp");
System.out.println ("Database connection established"); }
catch (Exception ex){
System.out.println("it doz notSQLException: " + ex.getMessage()); }
//Statement instruction = connexion.createStatement();
//ResultSet resultat = instruction.executeQuery("insert into message(mail_desinateur,mail_destinataire,message) values("+destinateur+","+destinataire+","+message+")");
}
catch (Exception e){
System.out.println("echec pilote : "+e);
}
je recoi cette erreur !
it doz notSQLException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
merci d'avaaaance!
jai une bd mysql 5.5
pilote jdbc 5.1.16 sous forme de jar que jai ajoutera ma librairie ( java build path du projet)
jre 1.6
je travaille sous eclipse
voici mon code, le driver se charge mai jarrive pa a acceder a la base ! je suis perdue :!
String pilote = "com.mysql.jdbc.Driver";
try{
Class.forName(pilote);
try{
Connection connexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/mail","root","sp");
System.out.println ("Database connection established"); }
catch (Exception ex){
System.out.println("it doz notSQLException: " + ex.getMessage()); }
//Statement instruction = connexion.createStatement();
//ResultSet resultat = instruction.executeQuery("insert into message(mail_desinateur,mail_destinataire,message) values("+destinateur+","+destinataire+","+message+")");
}
catch (Exception e){
System.out.println("echec pilote : "+e);
}
je recoi cette erreur !
it doz notSQLException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
merci d'avaaaance!
A voir également:
- Mysql java jdbc driver
- Waptrick java football - Télécharger - Jeux vidéo
- Jeux java itel - Télécharger - Jeux vidéo
- Eclipse java - Télécharger - Langages
- Realtek audio driver - Télécharger - Pilotes & Matériel
- Java apk - Télécharger - Langages