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.
我正在通过preparedstatment执行选择查询,现在我必须根据结果集是否包含多个值来引发异常,所以我的问题是如何确定rs返回多个值。?
尝试这个:
ResultSet lResult = stmt.executeQuery("SELECT A,B,C FROM YOURTABLE"); boolean lMoreThanOne = lResult.first() && lResult.next();