報錯提示:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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 '? and t.colpas=?' at line 1
插入一條記錄可以實現,就是取數出現了問題
把 ResultSet rs = ps.executeQuery(sql); 改為 ResultSet rs = ps.executeQuery();