My question is about the Update query shown in eclipse using MySQL, received from the code below
This is my database:
I'm trying to do on eclipse the next update query but I'm having trouble
public static void update_Payment(String month,int number) {
String sqlupdate = "UPDATE tenant SET month=? WHERE appartmentnum =? ";
try {
PreparedStatement pst = connect.prepareStatement(sqlupdate);
pst.setInt(1, 4);
pst.setInt(2, 1);
pst.executeUpdate();
} catch (SQLException var2) {
var2.printStackTrace();
}
}
I know that I don't have column name month in my database, I just want to receive from the user the name of the month for example
this is working fine
when I change [the column name from ] month
to april
or jan
thx for help