0
查詢 「_latin」 是越來越每PARAM之前串接問題與查詢的PreparedStatement在Java和MySQL
java代碼:
PreparedStatement prepStmt = null;
QueryString = "SELECT FROM Student WHERE username=? AND password=? ";
prepStmt=con.prepareStatement(QueryString);
prepStmt.setString(1,un);
prepStmt.setString(2,pwd);
ResultSet rs;
System.out.println(prepStmt);
rs = prepStmt.executeQuery();
錯誤:
java.sql.SQLException: [MySQL][ODBC 5.1 Driver][mysqld-5.5.24-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM Student WHERE username=_latin1'wow' AND password=_latin1'hell'' at line 1
爲什麼它的發生,最新解決方案
這是表格:
你的un和pwd是什麼? –
您錯過了您的專欄列表。 – Perception