Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Au secours servlet Mysql driver

Featured Replies

Posté(e)

:francais:

salut j'arrive pas , j'arrive pas...

j'ai essayé de créer une table à partir de tomcat...pour faire un essai...

ça compile bien mais au moment de l'execution...no suitable driver OU

exception in threads "main" java.lang.NoClassDefFoundError:le nom du fichier (CreateCoffees)

Pourtant j'ai appelé dans le classpath:

mm.mysql-2.0.4-bin.jar

Je ne sais vraiment pas......y a quelque qui manque mais je ne sais pas quoi...

est-ce que vous pouvez m'aider svp :chinois:

voici mon code:

import java.sql.*;

public class CreateCoffees

{

public static void main(String args[])

{

String url="jdbc:mysql://localhost/these";

Connection con;

String createString;

createString = "create table COFFEES " +

"(COF_NAME VARCHAR(32), " +

"SUP_ID INTEGER, " +

"PRICE FLOAT, " +

"SALES INTEGER, " +

"TOTAL INTEGER)";

Statement stmt;

try

{

Class.forName("org.gjt.mm.mysql.Driver");

}

catch(java.lang.ClassNotFoundException e)

{

System.err.print("ClassNotFoundExceptionkk: ");

//System.err.println(e.getMessage());

}

try

{

con=DriverManager.getConnection("jdbc:mysql://localhost/these?user='root'&password='null'");

System.out.println("prends la connection");

stmt=con.createStatement();

stmt = con.createStatement();

stmt.executeUpdate(createString);

stmt.close();

con.close();

}

catch(SQLException ex)

{

System.err.println("SQLException: " + ex.getMessage());

}

}

}

Merci de me dépanner

:francais::francais:

Posté(e)

J'ai eu de nombreux problèmes de Classpath sous Windows.

Tu as essayé de rajouté le chemin du driver dans la ligne de commande de l'exécution ?

genre:

java -classpath="..." ...

  • 2 semaines après...
Posté(e)
  • Auteur

oui bien sûr...

j'ai essayé de faire la connexion entre mon prog java et ma base de données...

avec tomcat...pour faire une servlet(Mysql)

résultat:

ERROR: java.sql.SQLException: Invalid authorization specification: Access denied for user: ''root'@localhost' (Using password: YES)

j'arrive pas à accéder à la base de données que j'ai crée avec Mysql

par contre avec une bd access...c'est ok mais ça m'intéresse pas de d'utiliser access

merci de me dépanner...

:D

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.