Hello everybody
I have problem with my variables.
The data's of my table enfts are :
1234 Eric 1/1/2000
1234 Patrick 23/4/2010
When 1234 is selected then Eric and Patrick appair in my Combobox cboChildName.
Eric appairs first end Patrick at the second place and that's OK.
But the birthdate of Eric is 23/4/2010 instead of 1/1/2000. It's appairs in a texfield TxtChildBirth.
id, firstname et naiss are correct
What's the problem please.
Habiler
private void cboNatureActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: if (cboNature.getSelectedItem().toString().equalsIgnoreCase("412")){ jPanel2.setVisible(true); conn = ConnectDecisions.ConnectDB(); int MatrSelect = Integer.parseInt(txtMatricule.getText()); try { PreparedStatement stmt = conn.prepareStatement("select EMPLOYEENBR,CHILDNAME,BIRTHDATE from Enfts where EMPLOYEENBR = '"+ MatrSelect+"'"); ResultSet rs = stmt.executeQuery(); System.out.println("SQL Statement:\n\t" + MatrSelect); while(rs.next()) { String id = rs.getString("EMPLOYEENBR"); String firstName = rs.getString("CHILDNAME"); String Naiss = rs.getString("BIRTHDATE"); System.out.println("ID: " + id + ", First Name: " + firstName + ",BIRTHDATE: " + Naiss); cboChildName.addItem(firstName); txtChildBirth.setText(Naiss); } } catch (SQLException ex) { Logger.getLogger(AddData.class.getName()).log(Level.SEVERE, null, ex); } } else { jPanel2.setVisible(false); } }