Académique Documents
Professionnel Documents
Culture Documents
java.sql.*; public class Principale { public static void main(String[] args) { try { Class.forName("com.mysql.jdbc.Driver"); Connection connexion = DriverManager.getConnection("jdbc:mysql://localhost /gestion", "root", ""); Statement instruction = connexion.createStatement(); //ResultSet rsultat = instruction.executeQuery("SELECT * FROM personne"); String sql="CREATE TABLE n (Nom VARCHAR( 32 ) NOT NULL ,Prenom VARCHAR( 32 ) NOT NULL);"; instruction.executeUpdate(sql); /* while (rsultat.next()) { System.out.println("---------------------------------"); System.out.println("Nom : "+ rsultat.getString("Nom")); System.out.println("Prnom : "+ rsultat.getString("Prenom")); System.out.println("Civilit : "+ rsultat.getString("Civilite")); System.out.println("Age : "+ rsultat.getInt("age")); }*/
} catch (ClassNotFoundException ex) { System.err.println("Erreur Driver");} catch (SQLException ex) { System.err.println("Erreur Localisation BD");} } }