JDBC操作MySQL出现:This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, ...的问题解决
错误如下:
This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, can not use functions and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.
中文意思:结果集不可更新。此结果集必须来自使用ResultSet.CONCUR_UPDATABLE的结果集类型创建的语句,查询必须仅选择一个表,并且必须从该表中选择所有主键。有关更多详细信息,请参阅JDBC 2.1 API规范,第5.6节。
也就是说,表中必须要有主键ID。