我的java/jdbc代碼有問題。查詢JDBC Java
參數索引超出範圍(2號中的哪一個參數1)
代碼:
Connection c = null;
MySQL MySQL = new MySQL(Host, Port, Database, Username, Password);
c = MySQL.open();
Player player = (Player) sender;
String zapytanie = "UPDATE `?` SET `tag`=? WHERE `name`='?';";
PreparedStatement ps = c.prepareStatement(zapytanie);
ps.setString(1, Tabel);
ps.setString(2, red);
ps.setString(3, player());
ps.executeUpdate(); //Executes the query
ps.close(); //Closes the query
c.close();
難道這有什麼做的'引號? – austin