0% found this document useful (0 votes)
2 views1 page

recher

The document contains Java code for updating patient information in a database. It checks if a text field is empty and prompts the user for confirmation before executing an SQL update statement. If successful, it displays a success message and clears the input fields.

Uploaded by

tsokuyomi07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

recher

The document contains Java code for updating patient information in a database. It checks if a text field is empty and prompts the user for confirmation before executing an SQL update statement. If successful, it displays a success message and clears the input fields.

Uploaded by

tsokuyomi07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

String a;

a=T1.getText();
if((a.isEmpty())){
JOptionPane.showMessageDialog(null," lazmak te5tar elli bech tsal7a!!");
}else { int option=JOptionPane.showConfirmDialog(null,
"t7eb tsal7a bel7ag?",
"Modification School Manager",JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (option==0) {
String sql="update patient set nom=?,prenom=?,adress=?,telephone=?,email=? where
cin=?";
try { pst=conn.preareStatement(sql);
pst.setString(1, T2.getText());
pst.setString(2, T3.getText());
pst.setString(3, T4.getText());
pst.setString(4, T5.getText());
pst.setString(5, T6.getText());
pst.setString(6, T1.getText());
pst.execute();
JOptionPane.showMessageDialog(null, "Enregistrement effectu� avec
succ�s");
T1.setText("");
T2.setText("");
T3.setText("");
T4.setText("");
T5.setText("");
T6.setText("");
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e); }}}
��� ���� ���� ��� ����� �� ����� ���� ���� ���� ������ ��� ���� . ������ ���� ����
������ ����� ���� ��� ����

JFileChooser chooser=new JFileChooser();


chooser

You might also like