Originally Posted by
John Joe
where is your update query?
lol it isn't bro, this is my query. I know I have to change something in the update bracket but I just dont know what. I also have to include the deposit variable somewhere.
private void btnDepositActionPerformed(java.awt.event.ActionEve nt evt) {
// TODO add your handling code here:
try
{
PreparedStatement statUpdate=con.prepareStatement
("update Customer_Details set AccountBalance=? where AccountNumber=?");
statUpdate.setString(1,txtMAccBalance.getText());
statUpdate.setString(2,txtMAccNo.getText());
// call executeUpdate to execute our sql update statement
int rowsAffected=statUpdate.executeUpdate();
if(rowsAffected>0)
{
JOptionPane.showMessageDialog(null,"Data Updated..");
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null,"Error encountered while updating data in the database: " +ex, "ManageTransaction",JOptionPane.ERROR_MESSAGE) ;
}