但系统是这样报错的呀。
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
C:\tomcat\work\localhost_8080%2Fwen\_0002fwww_0002ejspwww_jsp_0.java:68: Ambiguous class: java.beans.Statement and java.sql.Statement
                Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 
                ^
1 error, 1 warning

解决方案 »

  1.   

    Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    这句没有错,你再检查一下是不是其他地方有没有错误。
      

  2.   

    你用这个试一下:Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                                                ResultSet.CONCUR_UPDATABLE);
      

  3.   

    Ambiguous class: java.beans.Statement and java.sql.Statement
                    Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 显示无法判定Statement属于哪个包里的哪个类....
      

  4.   

    有如下代码:
    package com.testing.session;import java.sql.*;public class Conn {
        String sDBDriver="com.microsoft.jdbc.sqlserver.SQLServerDriver";
        String sConnStr="jdbc:microsoft:sqlserver://T2:1433;DatabaseName=SCMS0708";
        Connection conn=null;
        ResultSet rs=null;
        
        //注册
        public Conn(){
          try{
             Class.forName(sDBDriver);
          }catch(ClassNotFoundException e){
             System.out.println("无法建立数据库的连接:" + e.getMessage());
          }
        }
        
        public void executeUpdate(String sql) throws Exception
        {
           sql=new String(sql.getBytes("GBK"),"ISO8859_1");   
           try
           {
             conn=DriverManager.getConnection(sConnStr,"sa","sa");
      Statement stmt=conn.createStatement();
             stmt.executeUpdate(sql);
    conn.close();
    stmt.close();
           }catch(SQLException ex){
             System.out.println("更新数据操作失败!" + ex.getMessage());
           }
        }

    public ResultSet executeQuery(String sql) throws Exception
    {
    rs = null;
    try
    {
       sql= new String(sql.getBytes("GBK"),"ISO8859_1");
       conn= DriverManager.getConnection(sConnStr,"sa","sa");
       Statement stmt=conn.createStatement();
       rs=stmt.executeQuery(sql);
    }catch(SQLException ex){
       System.out.println("执行查询出错!"+ex.getMessage());
    }        
    return rs;
    }

    public void CloseExecQuery() throws Exception
    {
       try{
         conn.close();
       }catch(SQLException er){
         System.out.println("关闭错误!" + er.getMessage());
       }
    }
    }
      

  5.   

    java.beans.Statement 这个是不是自己写的最好不要和已有的包重名