日期:2014-05-20  浏览次数:20572 次

出现result set type is TYPE_FORWARD_ONLY的错误
用createStatement可以这样
connect=dataSource.getConnection();
Statement   stmt=connect.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,      
                                          ResultSet.CONCUR_UPDATABLE);
ResultSet   rs=stmt.executeQuery(strSql);
但我用的是stmt   =   conn.prepareStatement(   SQL   );
请问如何改变result   set   type

------解决方案--------------------
PreparedStatment pstmt = conn.prepareStatement(sql,ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
------解决方案--------------------
顶楼上的