try {
Class.forName("com.mysql.jdbc.Driver");
System.out.println("driver chargé");
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "erreur lors du chargement du driver");
}
try {
conexion = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/simulateur");
System.out.println("connexion etabie");
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "erreur lors de la connexion");
}
try {
ResultSet rs = null ;
String sql = "select 'SIM' from Inscription ";
PreparedStatement stmt =(PreparedStatement) conexion.prepareStatement(sql);
rs = stmt.executeQuery(sql);
while (rs.next())
{
SIMcb.addItem(rs.getString("SIM"));
}
}catch (Exception ex)
{ JOptionPane.showMessageDialog(null, "erreur");}
J'ai pas pu connaitre ou est mon probléme :s la connexion est établie avec succès mais mon combobox reste toujours vide :S
|