JAVA JDBC mySql Prepared statement Update query [duplicate]
问题 This question already has answers here : MySQLSyntaxErrorException near “?” when trying to execute PreparedStatement (2 answers) Closed 1 year ago . I am trying to execute the following code package jdbclesson; import java.sql.*; public class PreparedQuery { public static void main(String[] args) throws Exception { String url = "jdbc:mysql://localhost:3306/alien?useSSL=false"; String uname = "root"; String pass = "ma123"; String query = "UPDATE student SET username= ? where userid= ? ";