Unsupported method: ResultSet.last 错误

解决办法: 注意其中的

java.sql.ResultSet.TYPE_SCROLL_SENSITIVE,    java.sql.ResultSet.CONCUR_READ_ONLY



public void prepareStatement(String strSql){
         
try{
             prepstmt 
= this.conn.prepareStatement(strSql,java.sql.ResultSet.TYPE_SCROLL_SENSITIVE,
                     java.sql.ResultSet.CONCUR_READ_ONLY);
         }

         
catch(Exception e){
             e.printStackTrace(System.out);
             Debug.writeLog(
"In prepareStatement(String strSql), Exception Occured ! Info :" + e.getLocalizedMessage());
         }

    }





public ResultSet executeQuery(String strSql) {
         ResultSet rs
=null;
         
try{
             strSql
=new String(strSql.getBytes("GBK"),"ISO8859_1");
             Statement stmt 
= this.conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                     java.sql.ResultSet.CONCUR_READ_ONLY);
             rs 
= stmt.executeQuery(strSql);
         }

         
catch(Exception e){
             e.printStackTrace(System.out);
             Debug.writeLog(
"In executeQuery(String), Exception Occured ! Info :" + e.getLocalizedMessage());
         }

         
return rs;
     }

posted on 2007-12-20 21:04  Squall  阅读(1136)  评论(0编辑  收藏  举报

导航