I\'m using a MySQL database and accessing it through Java.
PreparedStatement prep1 = this.connection.prepareStatement(
\"UPDATE user_table
First of all, prepare the 'PreparedStatement' object using below constructor:
PreparedStatement pStmt = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
//here variable 'sql' is your query ("UPDATE user_table SET Level = 'Super' WHERE Username = ?")
Then, set your argument to 'pStmt'. In this case:
prep1.setString(1, username);
Finally, executeUpdate and get affected rows as an integer
int affectedRows = pStmt.executeUpdate();