[Déplacé ASP -> Java]probleme de connexion entre un programme java et ma base de

Résolu
haddouch21 - 31 août 2012 à 14:32
NHenry Messages postés 15113 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 22 avril 2024 - 31 août 2012 à 18:53
bonjour
je suis encore débutante en informatique et je suis en train de préparer un mini projet concernant la gestion des informations des étudiant en langage java avec la base de donné Access. Après la création de ma base de donnée, je l'ai configuré. Mais après saisir mon code la connexion n'est pas établi. voila mon code ci dessous et merci de répondre si vous voyez fautes ou autres.
ma base donnée est de nom Database51 et la table est de nom etu
//le code:
package introduction;

import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;


public class formsta extends javax.swing.JFrame {

/**
* Creates new form formsta
*/
public formsta() {
initComponents();
}


@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

buttonGroup1 = new javax.swing.ButtonGroup();
buttonGroup2 = new javax.swing.ButtonGroup();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
textmatricule = new javax.swing.JTextField();
textnom = new javax.swing.JTextField();
textprenom = new javax.swing.JTextField();
textadresse = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
textemail = new javax.swing.JTextField();
textage = new javax.swing.JTextField();
textsexe = new javax.swing.JTextField();
textfiliere = new javax.swing.JTextField();
textsection = new javax.swing.JTextField();
textniveau = new javax.swing.JTextField();
textmoyen = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
tabletudiant = new javax.swing.JTable();
btnpremier = new javax.swing.JButton();
btnprecedent = new javax.swing.JButton();
btnsuivant = new javax.swing.JButton();
btndernier = new javax.swing.JButton();
btnajouter = new javax.swing.JButton();
btnmodifier = new javax.swing.JButton();
btnsupprimer = new javax.swing.JButton();
jLabel12 = new javax.swing.JLabel();
jRadioButton1 = new javax.swing.JRadioButton();
jRadioButton2 = new javax.swing.JRadioButton();
txtrecherche = new javax.swing.JTextField();
btnrechercher = new javax.swing.JButton();
btnafficher = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setFont(new java.awt.Font("Century Gothic", 1, 10)); // NOI18N
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});

jLabel1.setText("matricule");

jLabel2.setText("nom");

jLabel3.setText("prenom");

jLabel4.setText("adresse");

textmatricule.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
textmatriculeActionPerformed(evt);
}
});

jLabel5.setText("email");

jLabel6.setText("age");

jLabel7.setText("sexe (F/M)");

jLabel8.setText("filière");

jLabel9.setText("section");

jLabel10.setText("niveau");

jLabel11.setText("moyen");

textage.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
textageActionPerformed(evt);
}
});

textsection.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
textsectionActionPerformed(evt);
}
});

tabletudiant.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane1.setViewportView(tabletudiant);

btnpremier.setText("<<");

btnprecedent.setText("<");
btnprecedent.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnprecedentActionPerformed(evt);
}
});

btnsuivant.setText(">");

btndernier.setText(">>");
btndernier.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btndernierActionPerformed(evt);
}
});

btnajouter.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
btnajouter.setText("Ajouter");

btnmodifier.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
btnmodifier.setText("Modifier");

btnsupprimer.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
btnsupprimer.setText("Supprimer");
btnsupprimer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnsupprimerActionPerformed(evt);
}
});

jLabel12.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel12.setText("Recherche par: ");

buttonGroup1.add(jRadioButton1);
jRadioButton1.setText("matricule");

buttonGroup2.add(jRadioButton2);
jRadioButton2.setText("nom");

btnrechercher.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
btnrechercher.setText("Rechercher");

btnafficher.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
btnafficher.setText("Afficher");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel10)
.addGap(264, 264, 264)
.addComponent(jLabel12))
.addComponent(btnajouter, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnmodifier)
.addGroup(layout.createSequentialGroup()
.addComponent(jRadioButton1)
.addGap(18, 18, 18)
.addComponent(jRadioButton2)
.addGap(18, 18, 18)
.addComponent(txtrecherche, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addComponent(jLabel6)
.addGroup(layout.createSequentialGroup()
.addGap(344, 344, 344)
.addComponent(btnrechercher)
.addGap(26, 26, 26)
.addComponent(btnafficher)))
.addGap(0, 269, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel8)
.addComponent(jLabel9)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel1)
.addComponent(jLabel3)
.addComponent(jLabel2)
.addComponent(jLabel7)
.addComponent(jLabel11))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(461, 461, 461)
.addComponent(btnsupprimer))
.addGroup(layout.createSequentialGroup()
.addGap(201, 201, 201)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 672, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap(19, Short.MAX_VALUE))))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(textmatricule, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addComponent(btnpremier, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btnprecedent, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnsuivant, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btndernier, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(textnom, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(textprenom, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(textadresse, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(textemail, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(textsexe, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(textage, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1))
.addComponent(textfiliere, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(textsection, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(textniveau, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(textmoyen, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(textmatricule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(textnom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(textprenom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(textadresse, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(textemail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6)
.addComponent(textage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(textsexe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(btnajouter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnmodifier)
.addComponent(btnsupprimer)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(textfiliere, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9)
.addComponent(textsection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel10)
.addComponent(textniveau, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(9, 9, 9)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(textmoyen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnafficher)
.addComponent(btnrechercher))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(jRadioButton1)
.addComponent(jRadioButton2)
.addComponent(txtrecherche, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnpremier)
.addComponent(btnprecedent)
.addComponent(btnsuivant)
.addComponent(btndernier))
.addContainerGap())
);

pack();
}// </editor-fold>

private void btnprecedentActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void btndernierActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void textsectionActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void btnsupprimerActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

//
private void formWindowOpened(java.awt.event.WindowEvent evt) {
try{

//conexion avec base de donnée Database51
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");// charger le driver JDBC


//Dès qu'un driver a reconnu le gestionnaire de base de données correspondant à l'URL fournie, il lance une connexion à la base et utilise le nom d'utilisateur et le mot de passe indiqués. L'établissement de la connexion se fait selon le code suivant :
//Connection con = DriverManager.getConnection(NomUrl,"NomUtilisateur","MotDePasse");

//Dans notre exemple, l'accès concerne une base Access où les noms d'utilisateurs ne sont pas gérés :
cnx = DriverManager.getConnection("jdbc:odbc:Database51");// jdbc:odbc:database51 est l'url

//L'objet Connection créé va permettre d'interagir avec la base. Pour réaliser des requêtes de sélection, un objet de type Statement doit être généré.
//Statement symbolise une instrution SQL
st=cnx.createStatement();


dt =new DefaultTableModel();
dt.addColumn("matricule");
dt.addColumn("nom");
dt.addColumn("prenom");
dt.addColumn("adresse");
dt.addColumn("email");
dt.addColumn("age");
dt.addColumn("sexe(F/M)");
dt.addColumn("filière");
dt.addColumn("section");
dt.addColumn("niveau");
dt.addColumn("moyen");
tabletudiant.setModel(dt);
afficherListeEtudiant();

}catch (Exception e){
JOptionPane.showMessageDialog(null,"erreur de connexion\n"+e.getMessage()) ;
}

}

//procedure qui affiche la liste des etudiants

private void afficherListeEtudiant()
{
try
{
dt.setRowCount(0);
Rs=st.executeQuery("select * from etu");
while (Rs.next()){
matricule=Rs.getInt("matricule");
nom=Rs.getString("nom");
prenom=Rs.getString("prenom");
adresse=Rs.getString("adresse");
email=Rs.getString("email");
age=Rs.getInt("age");
sexe=Rs.getString("sexe (F/M)");
filière=Rs.getString("filière");
section=Rs.getInt("section");
niveau=Rs.getInt("niveau");
moyen=Rs.getDouble("moyen");
Object [] etu={matricule,nom,prenom,adresse,email,age,sexe,filière,section,niveau,moyen};
dt.addRow(etu);


}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"erreur 'afficher le liste des etudiants\n"+e.getMessage());

}

}
private void textmatriculeActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void textageActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(formsta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(formsta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(formsta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(formsta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>

/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {
new formsta().setVisible(true);
}
});
}
//declaration des variables
private Connection cnx;
private Statement st;
private ResultSet Rs;
private DefaultTableModel dt;
private int matricule , section, niveau, age,i;//i indice de deplacement
private String nom,prenom,adresse,email,sexe,filière;
private double moyen;

// Variables declaration - do not modify
private javax.swing.JButton btnafficher;
private javax.swing.JButton btnajouter;
private javax.swing.JButton btndernier;
private javax.swing.JButton btnmodifier;
private javax.swing.JButton btnprecedent;
private javax.swing.JButton btnpremier;
private javax.swing.JButton btnrechercher;
private javax.swing.JButton btnsuivant;
private javax.swing.JButton btnsupprimer;
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.ButtonGroup buttonGroup2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JRadioButton jRadioButton1;
private javax.swing.JRadioButton jRadioButton2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable tabletudiant;
private javax.swing.JTextField textadresse;
private javax.swing.JTextField textage;
private javax.swing.JTextField textemail;
private javax.swing.JTextField textfiliere;
private javax.swing.JTextField textmatricule;
private javax.swing.JTextField textmoyen;
private javax.swing.JTextField textniveau;
private javax.swing.JTextField textnom;
private javax.swing.JTextField textprenom;
private javax.swing.JTextField textsection;
private javax.swing.JTextField textsexe;
private javax.swing.JTextField txtrecherche;
// End of variables declaration
}

le message qui me parait lors de l'execution est "erreur d'afficher la liste des etudiants Column not found"

2 réponses

cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 16
31 août 2012 à 18:48
À vue de nez, y'a quelque part dans le code une référence à une colonne qui n'existe pas.
[pas le bon forum, je fais déplacer par un admin]

VB.NET is good ... VB6 is better
Utilise Réponse acceptée quand un post répond à ta question
3
NHenry Messages postés 15113 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 22 avril 2024 159
31 août 2012 à 18:53
Bonjour,

Merci ghuysmans99 pour le signalement.

Message déplacé.

Quand vous postez un code, merci d'utiliser la coloration syntaxique (3ième icône en partant de la droite : ).

---------------------------------------------------------------------
[list=ordered][*]Pour poser correctement une question et optimiser vos chances d'obtenir des réponses, pensez à lire le règlement CS, celui-ci pour bien poser votre question ou encore celui-ci pour les PFE et autres exercices.[*]Quand vous postez un code, merci d'utiliser la coloration syntaxique (3ième icône en partant de la droite : ).[*]En VB.NET pensez à activer Option Explicit et Option Strict (propriété du projet) et à retirer l'import automatique de l'espace de nom Microsoft.VisualBasic (onglet Références dans les propriétés du projet).[*]Si votre problème est résolu (et uniquement si c'est le cas), pensez à mettre "Réponse acceptée" sur le ou les messages qui vous ont aidés/list
---
Mon site
3
Rejoignez-nous
A voir également