突然出现  Class File Editor
Source not found
The source attachment does not contain the source for the file JdbcOdbcDriver.class
You can change the source attachment by clicking Change Attached Source below:然后是一个按钮。
我想说的是,连接数据库是正确的,登录,注册都可以。不知道怎么回事,当操作另一个数据表的时候就出现了这个问题。。我找不出来到底是怎么一回事望高手指导!!!
 

解决方案 »

  1.   

    JdbcOdbcDriver的问题,此外,使用后是否关闭?
      

  2.   

    The source attachment does not contain the source for the file JdbcOdbcDriver.class
      

  3.   

    这明显应该是eclipse显示源代码时报的
    两种情况,一种是你按ctrl跟踪方法的声明,而跟踪的类是第三方的,只有class没有源代码所以会提示这个
    第二种是调试时你按stacktrace里面的链接跳转过去的
      

  4.   

    哦对了,补充一下,还有可能是你设置了exception断点,调试时也会停下来显示源文件,但是第三方类是没有源文件的所以显示这个
      

  5.   

    选中工程,在菜单Run里面选择下方有个“remove all breakpoints”,试试看?
      

  6.   

    JdbcOdbcDriver.class的source在jdk目录的src.zip文件里,所以找到jdk目录下的src.zip就行了。
      

  7.   

    没有看到remove all breakpoints 这一项╮(╯▽╰)╭
      

  8.   

    我用的是 Myeclipse + Mysql + tomcat6.0
      

  9.   

    就是同一个数据库的,另一个表。比方说,数据库连接成功,并且用JavaBean编写user表操作类,然后实现了登录注册。另外,当操作document表示,就出现了这种情况,一个页面就是要显示document表的信息,可是一运行这个页面,就跳转到debug那,出现我说的情况,我不知道到底怎么回事??
      

  10.   

    操作document表是出现问题,是不是你写的对这个表的javabean有问题啊,看看
      

  11.   

    package com.ED;import java.sql.*;public class document extends Execute_DB {
    //定义类成员变量
    private long DocumentID;
    private String DocumentName;
    private long TypeID;
    private String Author;
    private String Introduction;
    private long ViewCount;

    private String strSql;

    //构造函数,对成员变量进行初始化赋值
    public document()
    {
    this.DocumentID = 0;
    this.DocumentName = "";
    this.TypeID = 0;
    this.Author = "";
    this.Introduction = "";
    this.ViewCount = 0;

    this.strSql = "";
    }

    //获取DocumentID对应的文档信息,将这些信息赋值给相应的类变量
    public boolean init()
    {
    this.strSql="select * from 'document_info' where DocumentID=";
    this.strSql=this.strSql+"'"+this.DocumentID+"'";
    try
    {
    ResultSet rs = super.exeSqlQuery(this.strSql);
    if(rs.next())
    {
    DocumentID=rs.getLong("DocumentID");
    DocumentName=rs.getString("DocumentName");
    TypeID=rs.getLong("TypeID");
    Author=rs.getString("Author");
    Introduction=rs.getString("introduction");
    return true;
    }
    else
    {
    return false;
    }
    }
    catch(Exception ex)
    {
    return false;
    }
    }

    //获得所有文档信息,返回一个ResultSet对象
    public ResultSet show_all_document()
    {
    this.strSql="select * from 'document_info' order by DocumentName asc";
    ResultSet rs=null;
    try
    {
    rs = super.exeSqlQuery(this.strSql);
    }
    catch(Exception ex)
    {
    System.out.println(ex.toString());
    }
    return rs;

    }


    }这就是那个JavaBean,然后我用页面显示user表的信息时,就能正确显示,但是一这个就不行了。
      

  12.   

    主要就是,用到,show_all_document()。。
      

  13.   

    this.strSql="select * from 'document_info' where DocumentID=";
    this.strSql=this.strSql+"'"+this.DocumentID+"'";
    这个语句为什么后面要加' '呢
      

  14.   

    private long DocumentID,这个变量不是字符串类型的,不要用引号
      

  15.   

    这个应该还好吧,DocumentID是从JSP页面传入的呀~~而且,user表操作的时候也有加‘’耶~~
    关键是,其实我觉得吧,JavaBean可能也没什么问题,以前是可以用的。不知道怎么搞的后来就不能用了。
    所以,我不知道到底是怎么一回事
      

  16.   

     <%
          request.setCharacterEncoding("GBK");
         //获取所有用户信息
         ResultSet rs=document.show_all_document();
         int i=0;
         while(rs.next())
         {
         int DocumentID=rs.getInt("DocumentID");
        %>
         <tr>
         <td width="10" align="center"><%=DocumentID%></td>
         <td width="40" align="left"><a href=user_detail.jsp?DocumentID=<%=DocumentID%>
         target="_self"><%=rs.getString("DocumentName")%></a></td>
         </tr>
        <%
         }
        %>
    现在 就是说 while(rs.next())有什么异常???
      

  17.   

    <%
      request.setCharacterEncoding("GBK");
      //获取所有用户信息
      ResultSet rs=document.show_all_document();
      int i=0;
      while(rs.next())
      {
      int DocumentID=rs.getInt("DocumentID");
      %>
      <tr>
      <td width="10" align="center"><%=DocumentID%></td>
      <td width="40" align="left"><a href=user_detail.jsp?DocumentID=<%=DocumentID%>
      target="_self"><%=rs.getString("DocumentName")%></a></td>
      </tr>
      <%
      }
      %>谁能告诉我,,这段代码有什么问题,提示这行while(rs.next())有什么exception抛出~~等~~~急~~~
      

  18.   

    可能是你设置了exception断点,调试时也会停下来显示源文件,但是第三方类是没有源文件的所以显示这个
      

  19.   

    我想是这句出问题了:
    rs = super.exeSqlQuery(this.strSql);
    能不能把Excute_DB的代码也贴出来
      

  20.   

    现在我已经取消了所有的断点了。。就说有异常了。。package com.ED;import java.sql.*;//这个类继承自Open_DB类
    public class Execute_DB extends Open_DB {

    //数据库连接对象
    private Connection dbConn;
    private Statement stmt;
    private ResultSet rs;
    //描述  错误号 0=无错误,-1 有错误
    private int errNum;
    //error 描述 错误信息
    private String errDesc;

    //初始化操作
    public Execute_DB()
    {
    dbConn = super.getConn();
    stmt = null;
    rs = null;
    errNum = 0;
    errDesc = "";
    }

    //执行sql 执行语句,主要是执行插入和删除的SQL语句
    public boolean exeSql(String strSql)
    {
    try
    {
    stmt = dbConn.createStatement();
    stmt.executeUpdate(strSql);
    stmt.close();
    return true;
    }
    catch(Exception ex)
    {
    this.errNum = -1;
    this.errDesc = ex.toString();
    return false;
    }
    }

    //执行 sql 查询语句
    public ResultSet exeSqlQuery(String strSql)
    {
    try
    {
    stmt =dbConn.createStatement();
    rs =stmt.executeQuery(strSql);
    }
    catch(Exception ex)
    {
    this.errNum = -1;
    this.errDesc = ex.toString();
    rs = null;
    }
    return rs;
    }
    //获取错误号码
    public int getErrNum()
    {
    return errNum;
    }

    //获取错误信息
    public String gerErrDesc()
    {
    return errDesc;
    }
    }
      

  21.   

    原因很简单, 是JRE设置正确, 在 Preference - Java - Installed JREs 查看JRE 是否指向正确, 版本因该和Properties - Java Compiler 一致
      

  22.   

    选中工程,在菜单Run里面选择下方有个“remove all breakpoints”,试试看?
      

  23.   

    选中工程,在菜单Run里面选择下方有个“remove all breakpoints”,试试看?我的就是这个原因!!!!!!!!
      

  24.   

    我遇到了,我是在启动tomcat时出现这个问题,原因就是因为有“断点”造成的,我按照9楼方法解决了