Q:
[Microsoft][SQLServer 2000 Driver for JDBC]Invalid operation for the current cursor position.
A:
问题很简单,默认打开时的游标不是在第一行上(而是在第一行之前),所以你根本不能取数据,当然需要使用rs.next()来移动游标才行.
ResultSet rs=stmt.executeQuery(sql);
后要先rs.next()一下,使游标定位,才可以取值.
title=rs.getString(2);
http://www.handandaily.com
转载于:https://www.cnblogs.com/kaixin110/archive/2008/02/27/1083976.html