换驱动,最好该为Type4的驱动。

解决方案 »

  1.   

    我用了几种都不行
    包括
    weblogic.jdbc.mssqlserver4.Driver
    odbc driver
    MSSQL SERVER的JDBC驱动(从微软下载)
    换驱动,最好该为Type4的驱动,怎么操作
      

  2.   

    ODBC-JDBC肯定不行,微软的不行,那就是你的Statement有问题了,请别建立仅向前的Statement。
    你可以        statement = connection.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE,
                    ResultSet.CONCUR_READ_ONLY );
      

  3.   

    你要向记录集开始滚动,你必须要在创建Statement的时候设置为允许比如我的就是用的是MS的驱动。完全没有问题呀      Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
          ResultSet rs=stmt.executeQuery(sql);
    说明:
    CONCUR_READ_ONLY           The constant indicating the concurrency mode for a ResultSet object that may NOT be updated.static intCONCUR_UPDATABLE           The constant indicating the concurrency mode for a ResultSet object that may be updated.static intFETCH_FORWARD           The constant indicating that the rows in a result set will be processed in a forward direction; first-to-last.static intFETCH_REVERSE           The constant indicating that the rows in a result set will be processed in a reverse direction; last-to-first.static intFETCH_UNKNOWN           The constant indicating that the order in which rows in a result set will be processed is unknown.static intTYPE_FORWARD_ONLY           The constant indicating the type for a ResultSet object whose cursor may move only forward.static intTYPE_SCROLL_INSENSITIVE           The constant indicating the type for a ResultSet object that is scrollable but generally not sensitive to changes made by others.static intTYPE_SCROLL_SENSITIVE           The constant indicating the type for a ResultSet object that is scrollable and generally sensitive to changes made by others
      

  4.   


          Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
          ResultSet rs=stmt.executeQuery(sql);
    仍不行
    我的JDBC
    用的是JB7
    默认的驱动,不知是不是有问题
    不过错误提示是JDBC2.0错误
    error : This JDBC 2.0 method is not implemented
      

  5.   

    OK了
    weblogic.jdbc.mssqlserver4.Driver原来也不行
    SQL本身就可以
    谢谢大家Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
          ResultSet rs=stmt.executeQuery(sql);