I'm just learning and don't understand how to update individual columns in a table, I'm using MySQL. The table name is card and I want to update the pincode column. java.sql.SQLSyntaxErrorException: There is an error in your SQL syntax; check the manual for your MySQL server version for the correct syntax to use near line 1 "UPDATE COLUMN pincode = strPincodeNew"
public void newPC1(String strPincodeNew, String cardNumber) { try { Connection c = Database.connection(); Statement stmt11 = c.createStatement(); String sql12="ALTER TABLE card UPDATE COLUMN pincode = strPincodeNew"; stmt11.executeUpdate(sql12);
while (pincodeNew>=....) { System.out.println("\n\n==== 输入新的PIN码 ====\n"); pincodeNew = scanner.nextInt(); } String strPincodeNew = String.valueOf(pincodeNew); operation.newPC1(strPincodeNew, cardNumber); System.out.println("PIN码已成功更改");
Rewritten different commands
Please try the following. If necessary, please correct the card number listing: