1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| 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();
Statement requete;
try {
requete = conn.createStatement();
int MatrSelect = Integer.parseInt(txtMatricule.getText());
// Date ChildNaiss = rsEnfts.getTime(2);
ResultSet rsEnfts= requete.executeQuery("select EMPLOYEENBR,CHILDNAME,BIRTHDATE from Enfts where EMPLOYEENBR = '"+ MatrSelect+"' and BIRTHDATE= ?");
while(rsEnfts.next()) {
{
cboChildName.addItem(rsEnfts.getString(2));
txtChildBirth.setText(rsEnfts.getString(3));
}
}
} catch (SQLException ex) {
Logger.getLogger(AddData.class.getName()).log(Level.SEVERE, null, ex);
}
}
else {
jPanel2.setVisible(false);
} |
Partager