- Messages
- 97
- Reaction score
- 1
- Points
- 28
hello ts, newbie lang po sa java. pa help naman po. nag try ako mag update record sa textfields. kaya lang kelangan ko pa i close ung program then run the program uli para makita yung updated data sa textfields.
is there a way po ba para ma refresh yung data para hindi ako lagi mag close application?
maraming salamat po.
is there a way po ba para ma refresh yung data para hindi ako lagi mag close application?
maraming salamat po.
Code:
// Update Record Button
String colCountry = txtCountry.getText();
String colCapital = txtCapital.getText();
String colCurrency = txtCurrency.getText();
String colContinent = txtContinent.getText();
String colID = txtCID.getText();
int newColID = Integer.parseInt(colID);
String sql = "UPDATE TBLCOUNTRY set COUNTRYID ='"+newColID+"',COUNTRY='"+colCountry+"',CAPITAL='"+colCapital+"',CURRENCY='" +colCurrency+"',CONTINENT='" +colContinent+"' where COUNTRYID='"+newColID+"'";
JOptionPane.showMessageDialog(MRDBCountry.this, "Record Updated!");
pst=dbCon.prepareStatement(sql);
pst.execute();