行集问题
package test;
import java.sql.*;
import com.sun.rowset.CachedRowSetImpl;
import javax.sql.rowset.CachedRowSet;
public class a {
public static void main(String[] args) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
CachedRowSet rowset = new CachedRowSetImpl();
rowset.setUrl("jdbc:odbc:test");
rowset.setUsername("");
rowset.setPassword("");
rowset.setCommand("select * from stuinfo");
rowset.execute();
while (rowset.next()) {
System.out.println(rowset.getString(1));
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
报java.lang.UnsupportedOperationException
异常 请问应该怎么改? 谢谢!