Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
String query = "insert into dept values(?,'?','?'))"; PreparedStatement pu=con.prepareStatement(query); pu.setInt(1, 2); pu.setString(2, "a"); pu.setString(3, "ss"); pu.execute(query);
删除问号周围的引号。
占位符字符周围的单引号导致此错误。删除它们:
String query = "insert into dept values(?,?,?))";