Exception à l'exe d'un ResultSet
Bonjour,
J'ai une exception qui se produit au moment au je lance ma procédure. En fait, je fait un système de recherche où l'utilisateur peut soit rechercher par l'identifiant soit par le nom et prénom. J'utilise une Combo Box pour qu'il sélectionne sa méthode de recherche et un Field pour qui saisisse la valeur.
Voici le bout de code qui me paraît incriminé:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
private void jBtnRechActionPerformed(java.awt.event.ActionEvent evt) {
int choix = ComboRech.getSelectedIndex();
System.out.println(choix);
Connexion conn = new Connexion();
switch (choix) {
case 0 :{
try {
String ident = jTRech.getText();
String param = "SELECT * FROM client WHERE idClient=" + ident;
Statement stmt = conn.Connect();
ResultSet rs = stmt.executeQuery(param);
String NomClient = rs.getString("NomClient");
} catch (ClassNotFoundException ex) {
Logger.getLogger(FicheClient.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(FicheClient.class.getName()).log(Level.SEVERE, null, ex);
}
}
break; |
Et voici une partie de l'exception retournée :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
6 sept. 2008 11:33:37 gestionaid.FicheClient jBtnRechActionPerformed
GRAVE: null
java.sql.SQLException
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetImpl.checkRowPos(ResultSetImpl.java:817)
at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5514)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5434)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5474)
at gestionaid.FicheClient.jBtnRechActionPerformed(FicheClient.java:213)
at gestionaid.FicheClient.access$000(FicheClient.java:19)
at gestionaid.FicheClient$1.actionPerformed(FicheClient.java:88)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) |
J'ai beau retourner le code dans tous les sens, je n'arrive pas à trouver le problème.
Pourriez-vous m'éclairer?
Merci