Attempt to call a method related to scrollability of non-scrollable ResultSet. 오류 문의

by cuins posted Jul 28, 2011

Attempt to call a method related to scrollability of non-scrollable ResultSet. 오류 문의

 

안녕하세요 테스트 중에 안되는 생겨서 문의 드립니다.

 

Connection conn = null;
PreparedStatement pstmt = null;
PreparedStatement pstmt2 = null;
ResultSet rs = null;
ResultSet rs2 = null;


.

.

.

 

try{

 pstmt = conn.prepareStatement(sql);
 rs = pstmt.executeQuery();
 rs.last();
 cnt = rs.getRow();
 rs.beforeFirst();
 conn.commit();
 }catch(SQLException e){
 System.out.println(e.getMessage());
}

rs.last() 으로 커서를 마지막으로 옮기고 rs.getRow() 으로 row수를 가져 오려고 하는데

rs.last() 이부분에 exception 이 발생합니다.

따로 설졍해줘야 할 부분이 있나요?


Articles